fix(skills): allow tenant admins to delete tenant skill folders#195
Open
Atlas-SZ wants to merge 1 commit intodataelement:mainfrom
Open
fix(skills): allow tenant admins to delete tenant skill folders#195Atlas-SZ wants to merge 1 commit intodataelement:mainfrom
Atlas-SZ wants to merge 1 commit intodataelement:mainfrom
Conversation
…ctions Issue dataelement#180 mixed two failures: enterprise skill management was still platform-admin only, and the shared FileBrowser hid delete actions for directories, which made agent skill folders look undeletable even when the backend delete path worked. This change scopes skill CRUD and browse writes/deletes to the current tenant for org admins, keeps builtin and cross-tenant skills read-only for them, and avoids iterating lazy files on freshly created skills. The FileBrowser now shows delete actions for directories so skill folders expose the same operation the backend already supports. Constraint: org_admin access must stay tenant-bounded and must not allow editing builtin platform skills Rejected: Grant org_admin full platform_admin-equivalent skill access | would let tenant admins modify builtin or other-tenant skills Rejected: Fix only backend permissions | leaves skill folders with no visible delete affordance in the agent UI Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep skill write/delete rules aligned between direct CRUD and browse endpoints; changing one without the other will reintroduce inconsistent UI behavior Tested: backend/.venv/bin/python -m pytest backend/tests/test_skills_api.py -q; backend/.venv/bin/python -m ruff check backend/app/api/skills.py backend/tests/test_skills_api.py; cd frontend && npm run build; manual API verification for orgadmin browse-write/browse-delete/direct-delete Not-tested: full end-to-end browser deletion flow after page reload under every role combination
Collaborator
|
@wisdomqin 属于功能层面的pr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
org_adminto manage tenant-scoped custom skills from enterprise settingsbrowse/writewhen creating a new skill folderFileBrowser, so agent skill folders expose the backend delete capabilityFixes #180
Fixes #169
Changed Files
backend/app/api/skills.pybackend/tests/test_skills_api.pyfrontend/src/components/FileBrowser.tsxSimplifications
get_current_adminrole boundary instead of introducing new auth helpersVerification
cd backend && .venv/bin/python -m pytest tests/test_skills_api.py -qcd backend && .venv/bin/python -m ruff check app/api/skills.py tests/test_skills_api.pycd frontend && npm run buildorgadmin:PUT /api/skills/browse/write,DELETE /api/skills/browse/delete, andDELETE /api/skills/{id}all returned200Remaining Risks