mirror of
https://github.com/ansible/awx.git
synced 2026-01-10 15:32:07 -03:30
Fix a problem with IsSystemAdminOrAuditor for anonymous users
It was raising an error, but should really show the message about not being authenticated.
This commit is contained in:
parent
6a131f70f0
commit
dea5fd1a9d
@ -243,7 +243,7 @@ class IsSystemAdminOrAuditor(permissions.BasePermission):
|
||||
"""
|
||||
|
||||
def has_permission(self, request, view):
|
||||
if not request.user:
|
||||
if not (request.user and request.user.is_authenticated):
|
||||
return False
|
||||
if request.method == 'GET':
|
||||
return request.user.is_superuser or request.user.is_system_auditor
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user