Skip to content

fix: Delegated user list interface - #8233

Merged
shaohuzhang1 merged 1 commit into
v3from
pr@v3@fix_user_list
Nov 30, 2026
Merged

shaohuzhang1 merged 1 commit into
v3from
pr@v3@fix_user_list

Conversation

@shaohuzhang1

Copy link
Copy Markdown
Contributor

fix: Delegated user list interface

Comment thread apps/users/views/user.py
)
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).

@shaohuzhang1
shaohuzhang1 merged commit eb359a6 into v3 Nov 30, 2026
3 of 4 checks passed
@shaohuzhang1
shaohuzhang1 deleted the pr@v3@fix_user_list branch November 30, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant