diff --git a/awx/ui/static/js/helpers/Access.js b/awx/ui/static/js/helpers/Access.js index 6e7aed58a0..0023ecc41a 100644 --- a/awx/ui/static/js/helpers/Access.js +++ b/awx/ui/static/js/helpers/Access.js @@ -11,12 +11,14 @@ angular.module('AccessHelper', ['RestServices', 'Utilities']) - .factory('CheckAccess', ['$rootScope', 'Alert', 'Rest', 'GetBasePath', 'ProcessErrors', function ($rootScope, Alert, Rest, GetBasePath, ProcessErrors) { + .factory('CheckAccess', ['$rootScope', 'Alert', 'Rest', 'GetBasePath', 'ProcessErrors', '$cookieStore', function ($rootScope, Alert, Rest, GetBasePath, ProcessErrors, $cookieStore) { return function (params) { // set PermissionAddAllowed to true or false based on user access. admins and org admins are granted // accesss. - var me = $rootScope.current_user, - scope = params.scope; + var scope = params.scope, me; + + // uer may have refreshed the browser, in which case retrieve current user info from session cookie + me = ($rootScope.current_user) ? $rootScope.current_user : $cookieStore.get('current_user'); if (me.is_superuser) { scope.PermissionAddAllowed = true; diff --git a/awx/ui/static/js/helpers/Permissions.js b/awx/ui/static/js/helpers/Permissions.js index b98e73fd19..f004fb218b 100644 --- a/awx/ui/static/js/helpers/Permissions.js +++ b/awx/ui/static/js/helpers/Permissions.js @@ -45,4 +45,4 @@ angular.module('PermissionsHelper', []) } }; } -]); \ No newline at end of file +]); diff --git a/awx/ui/static/lib/ansible/generator-helpers.js b/awx/ui/static/lib/ansible/generator-helpers.js index 137660602e..3ebefc465d 100644 --- a/awx/ui/static/lib/ansible/generator-helpers.js +++ b/awx/ui/static/lib/ansible/generator-helpers.js @@ -693,7 +693,7 @@ angular.module('GeneratorHelpers', []) html += "\n"; html += "
\n"; html += "