mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 20:00:43 -03:30
Disable host filter lookup for users who don't have edit permissions. Hide delete/edit inv list icons for users who don't have proper permissions.
This commit is contained in:
parent
0cbe083dcf
commit
29fcf336c1
@ -98,8 +98,7 @@ export default ['i18n', function(i18n) {
|
||||
ngClick: 'editInventory(inventory)',
|
||||
awToolTip: i18n._('Edit inventory'),
|
||||
dataPlacement: 'top',
|
||||
ngShow: 'inventory.summary_fields.user_capabilities.edit',
|
||||
ngHide: 'inventory.pending_deletion'
|
||||
ngShow: '!inventory.pending_deletion && inventory.summary_fields.user_capabilities.edit'
|
||||
},
|
||||
view: {
|
||||
label: i18n._('View'),
|
||||
@ -113,8 +112,7 @@ export default ['i18n', function(i18n) {
|
||||
ngClick: "deleteInventory(inventory.id, inventory.name)",
|
||||
awToolTip: i18n._('Delete inventory'),
|
||||
dataPlacement: 'top',
|
||||
ngShow: 'inventory.summary_fields.user_capabilities.delete',
|
||||
ngHide: 'inventory.pending_deletion'
|
||||
ngShow: '!inventory.pending_deletion && inventory.summary_fields.user_capabilities.delete'
|
||||
|
||||
},
|
||||
pending_deletion: {
|
||||
|
||||
@ -10,7 +10,8 @@ export default ['templateUrl', '$compile',
|
||||
function(templateUrl, $compile) {
|
||||
return {
|
||||
scope: {
|
||||
hostFilter: '='
|
||||
hostFilter: '=',
|
||||
fieldIsDisabled: '='
|
||||
},
|
||||
restrict: 'E',
|
||||
templateUrl: templateUrl('inventories-hosts/inventories/smart-inventory/smart-inventory-host-filter/smart-inventory-host-filter'),
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="input-group Form-mixedInputGroup">
|
||||
<span class="input-group-btn Form-variableHeightButtonGroup">
|
||||
<button type="button" class="Form-lookupButton Form-lookupButton--variableHeight btn btn-default" ng-click="openHostFilterModal()">
|
||||
<button type="button" class="Form-lookupButton Form-lookupButton--variableHeight btn btn-default" ng-click="openHostFilterModal()" ng-disabled="fieldIsDisabled">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</span>
|
||||
|
||||
@ -64,7 +64,7 @@ export default ['i18n', 'InventoryCompletedJobsList', function(i18n, InventoryCo
|
||||
smart_hosts: {
|
||||
label: i18n._('Smart Host Filter'),
|
||||
type: 'custom',
|
||||
control: '<smart-inventory-host-filter host-filter="smart_hosts"></smart-inventory-host-filter>',
|
||||
control: '<smart-inventory-host-filter host-filter="smart_hosts" field-is-disabled="!(inventory_obj.summary_fields.user_capabilities.edit || canAdd)"></smart-inventory-host-filter>',
|
||||
awPopOver: "<p>" + i18n._("Populate the hosts for this inventory by using a search filter.") + "</p><p>" + i18n._("Example: ansible_facts.ansible_distribution:\"RedHat\"") + "</p><p>" + i18n._("Refer to the Ansible Tower documentation for further syntax and examples.") + "</p>",
|
||||
dataTitle: i18n._('Smart Host Filter'),
|
||||
dataPlacement: 'right',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user