diff --git a/awx/ui/static/js/controllers/Permissions.js b/awx/ui/static/js/controllers/Permissions.js index aefc176b38..e194a76c72 100644 --- a/awx/ui/static/js/controllers/Permissions.js +++ b/awx/ui/static/js/controllers/Permissions.js @@ -1,7 +1,7 @@ function PermissionsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, PermissionList, GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, - ClearScope, ProcessErrors, GetBasePath) + ClearScope, ProcessErrors, GetBasePath, CheckAccess) { ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior //scope. @@ -22,13 +22,13 @@ function PermissionsList ($scope, $rootScope, $location, $log, $routeParams, Res LoadBreadCrumbs(); scope.addPermission = function() { - if (checkAccess()) { + if (CheckAccess()) { $location.path($location.path() + '/add'); } } scope.editPermission = function(id) { - if (checkAccess()) { + if (CheckAccess()) { $location.path($location.path() + '/' + id); } } @@ -60,7 +60,7 @@ function PermissionsList ($scope, $rootScope, $location, $log, $routeParams, Res PermissionsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'PermissionList', 'GenerateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', - 'ClearScope', 'ProcessErrors', 'GetBasePath' + 'ClearScope', 'ProcessErrors', 'GetBasePath', 'CheckAccess' ]; diff --git a/awx/ui/static/js/forms/Teams.js b/awx/ui/static/js/forms/Teams.js index 5cf23f998e..747ae1767b 100644 --- a/awx/ui/static/js/forms/Teams.js +++ b/awx/ui/static/js/forms/Teams.js @@ -126,17 +126,20 @@ angular.module('TeamFormDefinition', []) label: 'Name', ngClick: "edit('permissions', \{\{ permission.id \}\}, '\{\{ permission.name \}\}')" }, + inventory: { + label: 'Inventory', + sourceModel: 'inventory', + sourceField: 'name', + ngBind: 'permission.summary_fields.inventory.name', + }, project: { label: 'Project', sourceModel: 'project', sourceField: 'name', ngBind: 'permission.summary_fields.project.name', }, - inventory: { - label: 'Inventory', - sourceModel: 'inventory', - sourceField: 'name', - ngBind: 'permission.summary_fields.inventory.name', + permission_type: { + label: 'Permission' } }, diff --git a/awx/ui/static/js/forms/Users.js b/awx/ui/static/js/forms/Users.js index 44885becb9..c2ed938b9d 100644 --- a/awx/ui/static/js/forms/Users.js +++ b/awx/ui/static/js/forms/Users.js @@ -163,18 +163,22 @@ angular.module('UserFormDefinition', []) label: 'Name', ngClick: "edit('permissions', \{\{ permission.id \}\}, '\{\{ permission.name \}\}')" }, + inventory: { + label: 'Inventory', + sourceModel: 'inventory', + sourceField: 'name', + ngBind: 'permission.summary_fields.inventory.name', + }, project: { label: 'Project', sourceModel: 'project', sourceField: 'name', ngBind: 'permission.summary_fields.project.name', }, - inventory: { - label: 'Inventory', - sourceModel: 'inventory', - sourceField: 'name', - ngBind: 'permission.summary_fields.inventory.name', + permission_type: { + label: 'Permission' } + }, fieldActions: { diff --git a/awx/ui/static/js/helpers/related-search.js b/awx/ui/static/js/helpers/related-search.js index 82ad4ab5ab..3e2744ffbf 100644 --- a/awx/ui/static/js/helpers/related-search.js +++ b/awx/ui/static/js/helpers/related-search.js @@ -60,7 +60,7 @@ angular.module('RelatedSearchHelper', ['RestServices', 'Utilities','RefreshRelat for (var related in form.related) { if ( form.related[related].iterator == iterator ) { - var f = form.related[set].fields[fld]; + var f = form.related[related].fields[fld]; } } @@ -71,15 +71,15 @@ angular.module('RelatedSearchHelper', ['RestServices', 'Utilities','RefreshRelat scope[iterator + 'HideSearchType'] = false; scope[iterator + 'InputHide'] = false; - if (f.searchType && f.searchType == 'gtzero') { + if (f.searchType !== undefined && f.searchType == 'gtzero') { scope[iterator + "InputHide"] = true; } - if (f.searchType && (f.searchType == 'boolean' + if (f.searchType !== undefined && (f.searchType == 'boolean' || f.searchType == 'select')) { scope[iterator + 'SelectShow'] = true; scope[iterator + 'SearchSelectOpts'] = f.searchOptions; } - if (f.searchType && f.searchType == 'int') { + if (f.searchType !== undefined && f.searchType == 'int') { scope[iterator + 'HideSearchType'] = true; } diff --git a/awx/ui/static/js/lists/Permissions.js b/awx/ui/static/js/lists/Permissions.js index fbb0df7afa..4fd6513d83 100644 --- a/awx/ui/static/js/lists/Permissions.js +++ b/awx/ui/static/js/lists/Permissions.js @@ -24,8 +24,11 @@ angular.module('PermissionListDefinition', []) label: 'Name', ngClick: 'editPermission(\{\{ permission.id \}\})' }, - description: { - label: 'Description' + inventory: { + label: 'Inventory', + sourceModel: 'inventory', + sourceField: 'name', + ngBind: 'permission.summary_fields.inventory.name' }, project: { label: 'Project', @@ -33,12 +36,9 @@ angular.module('PermissionListDefinition', []) sourceField: 'name', ngBind: 'permission.summary_fields.project.name' }, - inventory: { - label: 'Inventory', - sourceModel: 'inventory', - sourceField: 'name', - ngBind: 'permission.summary_fields.inventory.name' - }, + permission_type: { + label: 'Permission' + } }, actions: {