mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
workflow endpoints should return 401 on invalid credentials
if you have a license that doesn't allow use of workflows, invalid credentials yielded an HTTP 402; this commit changes the precedence see: https://github.com/ansible/tower/issues/2950
This commit is contained in:
@@ -135,9 +135,10 @@ class WorkflowsEnforcementMixin(object):
|
|||||||
Mixin to check that license supports workflows.
|
Mixin to check that license supports workflows.
|
||||||
'''
|
'''
|
||||||
def check_permissions(self, request):
|
def check_permissions(self, request):
|
||||||
|
ret = super(WorkflowsEnforcementMixin, self).check_permissions(request)
|
||||||
if not feature_enabled('workflows') and request.method not in ('GET', 'OPTIONS', 'DELETE'):
|
if not feature_enabled('workflows') and request.method not in ('GET', 'OPTIONS', 'DELETE'):
|
||||||
raise LicenseForbids(_('Your license does not allow use of workflows.'))
|
raise LicenseForbids(_('Your license does not allow use of workflows.'))
|
||||||
return super(WorkflowsEnforcementMixin, self).check_permissions(request)
|
return ret
|
||||||
|
|
||||||
|
|
||||||
class UnifiedJobDeletionMixin(object):
|
class UnifiedJobDeletionMixin(object):
|
||||||
|
|||||||
Reference in New Issue
Block a user