mirror of
https://github.com/ansible/awx.git
synced 2026-03-08 21:19:26 -02: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user