mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Change RBAC field names from builtin to is_builtin
This commit is contained in:
1 parent
4dd3bc6a98
commit
4e33d29af8
7 files changed
+13
-13
No files matched your search
@@ -99,7 +99,7 @@ async def update_user_group(
|
||||
if not user_group:
|
||||
raise ControllerNotFoundError(f"User group '{user_group_id}' not found")
|
||||
|
||||
if user_group.builtin:
|
||||
if user_group.is_builtin:
|
||||
raise ControllerForbiddenError(f"Built-in user group '{user_group_id}' cannot be updated")
|
||||
|
||||
return await users_repo.update_user_group(user_group_id, user_group_update)
|
||||
@@ -121,7 +121,7 @@ async def delete_user_group(
|
||||
if not user_group:
|
||||
raise ControllerNotFoundError(f"User group '{user_group_id}' not found")
|
||||
|
||||
if user_group.builtin:
|
||||
if user_group.is_builtin:
|
||||
raise ControllerForbiddenError(f"Built-in user group '{user_group_id}' cannot be deleted")
|
||||
|
||||
success = await users_repo.delete_user_group(user_group_id)
|
||||
|
||||
@@ -95,7 +95,7 @@ async def update_role(
|
||||
if not role:
|
||||
raise ControllerNotFoundError(f"Role '{role_id}' not found")
|
||||
|
||||
if role.builtin:
|
||||
if role.is_builtin:
|
||||
raise ControllerForbiddenError(f"Built-in role '{role_id}' cannot be updated")
|
||||
|
||||
return await rbac_repo.update_role(role_id, role_update)
|
||||
@@ -114,7 +114,7 @@ async def delete_role(
|
||||
if not role:
|
||||
raise ControllerNotFoundError(f"Role '{role_id}' not found")
|
||||
|
||||
if role.builtin:
|
||||
if role.is_builtin:
|
||||
raise ControllerForbiddenError(f"Built-in role '{role_id}' cannot be deleted")
|
||||
|
||||
success = await rbac_repo.delete_role(role_id)
|
||||
|
||||
Reference in new issue
Block a user