1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

hide run commands for related host, groups nested hosts lists if user does not have permission

This commit is contained in:
John Mitchell 2017-08-22 16:07:55 -04:00
parent c2e8200c81
commit 813a66cafe
3 changed files with 6 additions and 4 deletions

View File

@ -6,10 +6,10 @@
export default ['$scope', 'NestedHostsListDefinition', '$rootScope', 'GetBasePath',
'rbacUiControlService', 'Dataset', '$state', '$filter', 'Prompt', 'Wait',
'HostsService', 'SetStatus', 'canAdd', 'GroupsService', 'ProcessErrors', 'groupData',
'HostsService', 'SetStatus', 'canAdd', 'GroupsService', 'ProcessErrors', 'groupData', 'inventoryData',
function($scope, NestedHostsListDefinition, $rootScope, GetBasePath,
rbacUiControlService, Dataset, $state, $filter, Prompt, Wait,
HostsService, SetStatus, canAdd, GroupsService, ProcessErrors, groupData) {
HostsService, SetStatus, canAdd, GroupsService, ProcessErrors, groupData, inventoryData) {
let list = NestedHostsListDefinition;
@ -25,6 +25,8 @@ export default ['$scope', 'NestedHostsListDefinition', '$rootScope', 'GetBasePat
$scope[`${list.iterator}_dataset`] = Dataset.data;
$scope[list.name] = $scope[`${list.iterator}_dataset`].results;
$scope.inventory_obj = inventoryData;
$rootScope.flashMessage = null;
$scope.$watchCollection(list.name, function() {

View File

@ -102,7 +102,7 @@ export default ['i18n', function(i18n) {
showTipWhenDisabled: true,
tooltipInnerClass: "Tooltip-wide",
// TODO: we don't always want to show this
ngShow: true
ngShow: 'inventory_obj.summary_fields.user_capabilities.adhoc'
},
refresh: {
mode: 'all',

View File

@ -115,7 +115,7 @@ export default ['i18n', function(i18n) {
showTipWhenDisabled: true,
tooltipInnerClass: "Tooltip-wide",
// TODO: we don't always want to show this
ngShow: true
ngShow: 'inventory_obj.summary_fields.user_capabilities.adhoc'
},
create: {
mode: 'all',