mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix sonar issue
This commit is contained in:
parent
5b4bf46f61
commit
0519a36fe1
@ -84,7 +84,7 @@ class ApiRolesIndexHandler(BaseApiHandler):
|
||||
|
||||
if (
|
||||
not superuser
|
||||
and not EnumPermissionsCrafty.ROLES_CONFIG in exec_user_permissions_crafty
|
||||
and EnumPermissionsCrafty.ROLES_CONFIG not in exec_user_permissions_crafty
|
||||
):
|
||||
return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"})
|
||||
|
||||
@ -117,7 +117,7 @@ class ApiRolesIndexHandler(BaseApiHandler):
|
||||
|
||||
if (
|
||||
not superuser
|
||||
and not EnumPermissionsCrafty.ROLES_CONFIG in exec_user_permissions_crafty
|
||||
and EnumPermissionsCrafty.ROLES_CONFIG not in exec_user_permissions_crafty
|
||||
):
|
||||
return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"})
|
||||
|
||||
|
@ -80,7 +80,7 @@ class ApiRolesRoleIndexHandler(BaseApiHandler):
|
||||
|
||||
if (
|
||||
not superuser
|
||||
and not EnumPermissionsCrafty.ROLES_CONFIG in exec_user_permissions_crafty
|
||||
and EnumPermissionsCrafty.ROLES_CONFIG not in exec_user_permissions_crafty
|
||||
):
|
||||
return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"})
|
||||
|
||||
@ -131,7 +131,7 @@ class ApiRolesRoleIndexHandler(BaseApiHandler):
|
||||
return
|
||||
(
|
||||
_,
|
||||
_,
|
||||
exec_user_permissions_crafty,
|
||||
_,
|
||||
superuser,
|
||||
user,
|
||||
@ -139,7 +139,10 @@ class ApiRolesRoleIndexHandler(BaseApiHandler):
|
||||
) = auth_data
|
||||
|
||||
role = self.controller.roles.get_role(role_id)
|
||||
if not superuser and user["user_id"] != role["manager"]:
|
||||
if not superuser and (
|
||||
user["user_id"] != role["manager"]
|
||||
or EnumPermissionsCrafty.ROLES_CONFIG not in exec_user_permissions_crafty
|
||||
):
|
||||
return self.finish_json(
|
||||
400,
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user