mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-16 22:38:18 +00:00
Add user permissions + RBAC tests.
This commit is contained in:
@ -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