Skip to content

Commit

Permalink
AAP-35609 Allow for ServiceTokenAuth in IsSuperUserOrAuditor
Browse files Browse the repository at this point in the history
  • Loading branch information
john-westcott-iv committed Dec 5, 2024
1 parent 48fd1ec commit 679230b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ansible_base/lib/utils/views/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class IsSuperuserOrAuditor(BasePermission):
"""

def has_permission(self, request, view):
if hasattr(view, 'allow_service_token') and getattr(view, 'allow_service_token') is True and request.auth == 'ServiceTokenAuthentication':
return True
if not (request.user and request.user.is_authenticated):
return False
if request.user.is_superuser:
Expand Down

0 comments on commit 679230b

Please sign in to comment.