Change RBAC field names from builtin to is_builtin

This commit is contained in:
grossmj committed 2021-06-03 16:24:38 +09:30
1 parent 4dd3bc6a98
commit 4e33d29af8
7 files changed
+13 -13

No files matched your search

+2 -2
View File
@@ -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)
+2 -2
View File
@@ -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)