fix: use the /access prefix when cleaning up ACEs on delete

The users, groups and roles routes are mounted under /access and ACE
paths follow the real route paths. The cleanup after deleting a user,
group or role looked at /users, /groups and /roles, so it never matched
any ACE. Typed ACEs were still removed by the foreign key cascade, but
an ACE on the resource path granted to another principal survived the
deletion.
This commit is contained in:
YueGuobin committed 2026-11-07 00:02:20 +08:00
1 parent f87f20cb27
commit 0914f44273
5 files changed
+65 -3

No files matched your search

+1 -1
View File
@@ -140,7 +140,7 @@ async def delete_user_group(
success = await users_repo.delete_user_group(user_group_id)
if not success:
raise ControllerError(f"User group '{user_group_id}' could not be deleted")
await rbac_repo.delete_all_ace_starting_with_path(f"/groups/{user_group_id}")
await rbac_repo.delete_all_ace_starting_with_path(f"/access/groups/{user_group_id}")
@router.get(