mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 06:21:15 +02:00
Add user permissions + RBAC tests.
This commit is contained in:
1 parent
36a27c0c19
commit
d65b49acaa
12 files changed
+554
-99
No files matched your search
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user