Skip to content

Commit

Permalink
fix: allow bypassing ownership check when admin role user tries to de…
Browse files Browse the repository at this point in the history
…lete folder (#2055)

Co-authored-by: Sanghun Lee <sanghun@lablup.com>
  • Loading branch information
lizable and fregataa committed Apr 23, 2024
1 parent 4f39048 commit 1d82df0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/2055.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a buggy restriction on VFolder deletion due to wrong query condition
4 changes: 4 additions & 0 deletions src/ai/backend/manager/api/vfolder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2195,6 +2195,7 @@ async def _delete(
entries = await query_accessible_vfolders(
conn,
user_uuid,
allow_privileged_access=True,
user_role=user_role,
domain_name=domain_name,
allowed_vfolder_types=allowed_vfolder_types,
Expand Down Expand Up @@ -2425,6 +2426,7 @@ async def delete_from_trash_bin(
entries = await query_accessible_vfolders(
conn,
user_uuid,
allow_privileged_access=True,
user_role=user_role,
domain_name=domain_name,
allowed_vfolder_types=allowed_vfolder_types,
Expand Down Expand Up @@ -2495,6 +2497,7 @@ async def purge(request: web.Request, params: PurgeRequestModel) -> web.Response
entries = await query_accessible_vfolders(
conn,
user_uuid,
allow_privileged_access=True,
user_role=user_role,
domain_name=domain_name,
allowed_vfolder_types=allowed_vfolder_types,
Expand Down Expand Up @@ -2556,6 +2559,7 @@ async def restore(request: web.Request, params: RestoreRequestModel) -> web.Resp
restore_targets = await query_accessible_vfolders(
conn,
user_uuid,
allow_privileged_access=True,
user_role=user_role,
domain_name=domain_name,
allowed_vfolder_types=allowed_vfolder_types,
Expand Down

0 comments on commit 1d82df0

Please sign in to comment.