refactor(BA-5795): unify delete actions into RBAC-enforced DeleteVFolderV2Action#11208
Merged
Merged
Conversation
…derV2Action Remove the separate delete_v2_rbac path and convert the existing delete_v2 action to use SingleEntityActionProcessor with RBAC validators, following the same pattern applied to purge_v2 in BA-5765. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fregataa
added a commit
that referenced
this pull request
Apr 21, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the v2 vfolder “delete” flow to remove the duplicated RBAC-specific action path and instead route DeleteVFolderV2Action through SingleEntityActionProcessor with RBAC validators, aligning with the earlier purge_v2 unification approach.
Changes:
- Removed
DeleteVFolderV2RBACAction/delete_v2_rbacand updated adapters/processors to useDeleteVFolderV2ActionviaSingleEntityActionProcessor. - Updated
VFolderService.delete_v2()to rely on RBAC at the processor layer and use request user context for host-permission checks. - Cleaned up adapter imports and delete/bulk-delete invocation paths accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ai/backend/manager/services/vfolder/services/vfolder.py | Refactors delete_v2() to be RBAC-processor-enforced and removes the legacy delete_v2_rbac() service method. |
| src/ai/backend/manager/services/vfolder/processors/vfolder.py | Switches delete_v2 to SingleEntityActionProcessor with RBAC validators and removes delete_v2_rbac support. |
| src/ai/backend/manager/services/vfolder/actions/vfolder_v2_rbac.py | Deletes the now-redundant RBAC-specific delete action definition. |
| src/ai/backend/manager/services/vfolder/actions/vfolder_v2.py | Converts DeleteVFolderV2Action to a single-entity RBAC action and updates result type accordingly. |
| src/ai/backend/manager/api/adapters/vfolder.py | Updates vfolder delete/bulk-delete to use DeleteVFolderV2Action via processors.vfolder.delete_v2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The admin/regular user fixtures were missing `main_access_key`, causing `ensure_host_permission_allowed_by_user` to fail with ObjectNotFound when resolving the user's keypair resource policy. Also fix module docstring in vfolder_v2.py to not overstate RBAC coverage. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bae0aa3 to
632cb1f
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jopemachine
approved these changes
Apr 21, 2026
jopemachine
pushed a commit
that referenced
this pull request
Apr 24, 2026
…derV2Action (#11208) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
delete_v2_rbac/DeleteVFolderV2RBACActionpath and convert the existingdelete_v2/DeleteVFolderV2Actionto useSingleEntityActionProcessorwith RBAC validatorspurge_v2in BA-5765Test plan
Resolves BA-5795