Skip to content

Commit

Permalink
updated isSuperUser permission class
Browse files Browse the repository at this point in the history
  • Loading branch information
DraKen0009 committed Nov 6, 2024
1 parent bf7a237 commit d274955
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion care/utils/custom_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@

class IsSuperUser(BasePermission):
def has_permission(self, request, view):
return request.user and request.user.is_superuser
return bool(
request.user
and request.user.is_authenticated
and request.user.is_active
and request.user.is_superuser
)

0 comments on commit d274955

Please sign in to comment.