diff --git a/awx/ui/client/src/controllers/Users.js b/awx/ui/client/src/controllers/Users.js index cef314f407..a305a3e133 100644 --- a/awx/ui/client/src/controllers/Users.js +++ b/awx/ui/client/src/controllers/Users.js @@ -221,9 +221,12 @@ export function UsersEdit($scope, $rootScope, $location, init(); function init() { + $scope.hidePagination = false; + $scope.hideSmartSearch = false; $scope.user_type_options = user_type_options; $scope.user_type = user_type_options[0]; $scope.$watch('user_type', user_type_sync($scope)); + $scope.$watch('is_superuser', hidePermissionsTabSmartSearchAndPaginationIfSuperUser($scope)); Rest.setUrl(defaultUrl); Wait('start'); Rest.get(defaultUrl).success(function(data) { @@ -271,6 +274,20 @@ export function UsersEdit($scope, $rootScope, $location, }); } + // Organizations and Teams tab pagination is hidden through other mechanism + function hidePermissionsTabSmartSearchAndPaginationIfSuperUser(scope) { + return function(isSuperuserNewValue) { + let shouldHide = isSuperuserNewValue; + if (shouldHide === true) { + scope.hidePagination = true; + scope.hideSmartSearch = true; + } else if (shouldHide === false) { + scope.hidePagination = false; + scope.hideSmartSearch = false; + } + }; + } + function setScopeFields(data) { _(data) diff --git a/awx/ui/client/src/forms/Users.js b/awx/ui/client/src/forms/Users.js index 672dd2beea..0e6c1a6aa2 100644 --- a/awx/ui/client/src/forms/Users.js +++ b/awx/ui/client/src/forms/Users.js @@ -210,7 +210,7 @@ export default awToolTip: i18n._('Grant Permission'), actionClass: 'btn List-buttonSubmit', buttonContent: '+ ' + i18n._('ADD PERMISSIONS'), - ngShow: '(user_obj.summary_fields.user_capabilities.edit || canAdd)' + ngShow: '(!is_superuser && (user_obj.summary_fields.user_capabilities.edit || canAdd))' } }, fieldActions: { diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index a4f45b6b47..070b637067 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -1844,7 +1844,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat // smart-search directive html += `
+ ng-hide="(${itm}.length === 0 && (searchTags | isEmpty)) || hideSmartSearch === true"> `; + html += ``; return html; } };