Repository navigation
fix: Delegated user list interface - #8233
Conversation
| ) | ||
| def get(self, request: Request): | ||
| nick_name = request.query_params.get("nick_name", None) | ||
| return result.success(UserManageSerializer().get_all_user_list(nick_name)) |
There was a problem hiding this comment.
The diff removes the @has_permissions decorator from the UserList.get() method.
Potential issues / irregularities:
-
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 howAPIViewhandles permissions. This is a security concern unless the permission is enforced elsewhere (e.g., globally or in another layer). -
Inconsistent API contract – The class still defines
parametersandresponsesfor documentation, and likely expects authenticated/permitted access. Removing the decorator without adjusting those docs can mislead consumers. -
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).
fix: Delegated user list interface