From 6c06344fdbe8242b231ec63c2c5633202e989a0c Mon Sep 17 00:00:00 2001 From: gconsidine Date: Mon, 17 Apr 2017 11:06:13 -0400 Subject: [PATCH] Fix permission modal in team settings A GET request is made to check permissions on job templates, workflow templates, inventories, etc. With a basic license, the workflow template request returns a 402. The logic in place accounted for 500-ish errors and 200s. Now if a 402 response is returned, it's excluded from the UI without affecting the other successful responses. --- .../src/access/add-rbac-user-team/rbac-user-team.partial.html | 3 ++- awx/ui/client/src/shared/smart-search/queryset.service.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/access/add-rbac-user-team/rbac-user-team.partial.html b/awx/ui/client/src/access/add-rbac-user-team/rbac-user-team.partial.html index f162e28c58..44394369a6 100644 --- a/awx/ui/client/src/access/add-rbac-user-team/rbac-user-team.partial.html +++ b/awx/ui/client/src/access/add-rbac-user-team/rbac-user-team.partial.html @@ -40,6 +40,7 @@
Workflow Templates
@@ -65,7 +66,7 @@
-
+
diff --git a/awx/ui/client/src/shared/smart-search/queryset.service.js b/awx/ui/client/src/shared/smart-search/queryset.service.js index 9484d10cef..c2800f0bf2 100644 --- a/awx/ui/client/src/shared/smart-search/queryset.service.js +++ b/awx/ui/client/src/shared/smart-search/queryset.service.js @@ -254,6 +254,10 @@ export default ['$q', 'Rest', 'ProcessErrors', '$rootScope', 'Wait', 'DjangoSear .catch(function(response) { Wait('stop'); + if (/^\/api\/v[0-9]+\/workflow_job_templates\/$/.test(endpoint) && response.status === 402) { + return response; + } + this.error(response.data, response.status); throw response;