Merge pull request #2965 from ryanpetrello/fix-2950

workflow endpoints should return 401 on invalid credentials
This commit is contained in:
Ryan Petrello
2018-08-31 11:16:18 -04:00
committed by GitHub

View File

@@ -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):