Add user permissions + RBAC tests.

This commit is contained in:
grossmj committed 2021-06-03 15:40:12 +09:30
1 parent 36a27c0c19
commit d65b49acaa
12 files changed
+554 -99

No files matched your search

+2 -2
View File
@@ -96,7 +96,7 @@ async def update_role(
raise ControllerNotFoundError(f"Role '{role_id}' not found")
if role.builtin:
raise ControllerForbiddenError(f"Role '{role_id}' cannot be updated")
raise ControllerForbiddenError(f"Built-in role '{role_id}' cannot be updated")
return await rbac_repo.update_role(role_id, role_update)
@@ -115,7 +115,7 @@ async def delete_role(
raise ControllerNotFoundError(f"Role '{role_id}' not found")
if role.builtin:
raise ControllerForbiddenError(f"Role '{role_id}' cannot be deleted")
raise ControllerForbiddenError(f"Built-in role '{role_id}' cannot be deleted")
success = await rbac_repo.delete_role(role_id)
if not success: