Skip to content

refactor(BA-5795): unify delete actions into RBAC-enforced DeleteVFolderV2Action#11208

Merged
jopemachine merged 3 commits into
mainfrom
feat/BA-5795-vfolder-delete-rbac-unify
Apr 21, 2026
Merged

refactor(BA-5795): unify delete actions into RBAC-enforced DeleteVFolderV2Action#11208
jopemachine merged 3 commits into
mainfrom
feat/BA-5795-vfolder-delete-rbac-unify

Conversation

@fregataa
Copy link
Copy Markdown
Member

@fregataa fregataa commented Apr 21, 2026

Summary

  • Remove the separate delete_v2_rbac / DeleteVFolderV2RBACAction path and convert the existing delete_v2 / DeleteVFolderV2Action to use SingleEntityActionProcessor with RBAC validators
  • Follows the same unification pattern applied to purge_v2 in BA-5765
  • Net removal of ~95 lines by eliminating the duplicated action, service method, and processor

Test plan

  • Verify single vfolder delete via GQL mutation triggers RBAC enforcement
  • Confirm non-privileged user is denied delete on project vfolders they lack permission for

Resolves BA-5795

…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>
Copilot AI review requested due to automatic review settings April 21, 2026 12:29
@github-actions github-actions Bot added the size:L 100~500 LoC label Apr 21, 2026
@github-actions github-actions Bot added the comp:manager Related to Manager component label Apr 21, 2026
fregataa added a commit that referenced this pull request Apr 21, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_rbac and updated adapters/processors to use DeleteVFolderV2Action via SingleEntityActionProcessor.
  • 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.

Comment thread src/ai/backend/manager/services/vfolder/actions/vfolder_v2.py Outdated
Comment thread src/ai/backend/manager/api/adapters/vfolder.py
Comment thread src/ai/backend/manager/services/vfolder/services/vfolder.py
@fregataa fregataa marked this pull request as draft April 21, 2026 13:20
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>
@fregataa fregataa force-pushed the feat/BA-5795-vfolder-delete-rbac-unify branch from bae0aa3 to 632cb1f Compare April 21, 2026 13:36
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@fregataa fregataa added this to the 26.5 milestone Apr 21, 2026
@fregataa fregataa requested a review from a team April 21, 2026 13:56
@fregataa fregataa marked this pull request as ready for review April 21, 2026 13:56
@jopemachine jopemachine merged commit 6c60edd into main Apr 21, 2026
37 checks passed
@jopemachine jopemachine deleted the feat/BA-5795-vfolder-delete-rbac-unify branch April 21, 2026 14:02
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:manager Related to Manager component size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants