Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions apps/users/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,6 @@ class UserList(APIView):
parameters=UserListApi.get_parameters(),
responses=UserListApi.get_response(),
)
@has_permissions(
RoleConstants.WORKSPACE_MANAGE,
RoleConstants.ADMIN,
RoleConstants.EXTENDS_ADMIN,
RoleConstants.EXTENDS_WORKSPACE_MANAGE,
RoleConstants.USER,
RoleConstants.EXTENDS_USER,
)
def get(self, request: Request):
nick_name = request.query_params.get("nick_name", None)
return result.success(UserManageSerializer().get_all_user_list(nick_name))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff removes the @has_permissions decorator from the UserList.get() method.

Potential issues / irregularities:

  1. Loss of authorization enforcement – The removed decorator previously restricted access based on roles (WORKSPACE_MANAGE, ADMIN, etc.). After this change, any authenticated (or even unauthenticated) user may be able to call this endpoint, depending on how APIView handles permissions. This is a security concern unless the permission is enforced elsewhere (e.g., globally or in another layer).

  2. Inconsistent API contract – The class still defines parameters and responses for documentation, and likely expects authenticated/permitted access. Removing the decorator without adjusting those docs can mislead consumers.

  3. Code clarity – If the removal is intentional (e.g., moving permission logic to a base class or middleware), consider adding a comment to explain why the decorator was removed, to avoid future confusion.

Optimization suggestions:

  • If the permission check is truly no longer needed, ensure that the view still performs necessary request-level validation (e.g., authentication).
  • If the decorator was moved or consolidated elsewhere, verify there’s no duplicate or conflicting permission logic.
  • Keep the permission logic centralized for maintainability.

Conclusion: The main issue is the potential security regression. Confirm that this deletion is intentional and covered by other means (e.g., global DRF default permission classes, router-level permissions, or middleware).

Expand Down
Loading