Skip to content

Commit f213207

Browse files
committed
fix: Tool permission of two common user role
1 parent 30dc776 commit f213207

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apps/common/auth/authentication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def exist_permissions_by_view_permission(user_role: List[RoleConstants],
5252
role_list = [user_r(request, kwargs) if callable(user_r) else user_r for user_r in
5353
permission.roleList]
5454
role_ok = any(list(map(lambda up: role_list.__contains__(up),
55-
role_list)))
55+
user_role)))
5656
permission_list = [user_p(request, kwargs) if callable(user_p) else user_p for user_p in
5757
permission.permissionList
5858
]

apps/tools/views/tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ class Pylint(APIView):
269269
tags=[_('Tool')] # type: ignore
270270
)
271271
@has_permissions(
272-
PermissionConstants.TOOL_CREATE.get_workspace_permission(),
273-
PermissionConstants.TOOL_EDIT.get_workspace_permission_workspace_manage_role(),
272+
PermissionConstants.TOOL_READ.get_workspace_permission(),
273+
PermissionConstants.TOOL_READ.get_workspace_permission_workspace_manage_role(),
274274
RoleConstants.WORKSPACE_MANAGE.get_workspace_role(),
275275
RoleConstants.USER.get_workspace_role()
276276
)

0 commit comments

Comments
 (0)