Skip to content

Misleading IsAdminUser signature #6497

@Vincent089

Description

@Vincent089

Class IsAdminUser has a misleading name as it only checks for "is_staff" which does not make the user an "admin"

class IsAdminUser(BasePermission):
"""
Allows access only to admin users.
"""

def has_permission(self, request, view):
    return bool(request.user and request.user.is_staff)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions