mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 08:18:43 -03:30
fix dangling rbac hide issues
This commit is contained in:
@@ -399,7 +399,7 @@ export default
|
|||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()', //$scope.function to call on click, optional
|
ngClick: 'formSave()', //$scope.function to call on click, optional
|
||||||
ngDisabled: "job_templates_form.$invalid || can_edit!==true",//true //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons
|
ngDisabled: "job_templates_form.$invalid",//true //Disable when $pristine or $invalid, optional and when can_edit = false, for permission reasons
|
||||||
ngShow: '(job_template_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngShow: '(job_template_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,10 +5,18 @@
|
|||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
export default
|
export default
|
||||||
['$state', '$stateParams', '$scope', 'HostForm', 'ParseTypeChange', 'GenerateForm', 'HostManageService',
|
['$state', '$stateParams', '$scope', 'HostForm', 'ParseTypeChange', 'GenerateForm', 'HostManageService', 'rbacUiControlService', 'GetBasePath',
|
||||||
function($state, $stateParams, $scope, HostForm, ParseTypeChange, GenerateForm, HostManageService){
|
function($state, $stateParams, $scope, HostForm, ParseTypeChange, GenerateForm, HostManageService, rbacUiControlService, GetBasePath){
|
||||||
var generator = GenerateForm,
|
var generator = GenerateForm,
|
||||||
form = HostForm;
|
form = HostForm;
|
||||||
|
|
||||||
|
$scope.canAdd = false;
|
||||||
|
|
||||||
|
rbacUiControlService.canAdd(GetBasePath('inventory') + $stateParams.inventory_id + "/hosts")
|
||||||
|
.then(function(canAdd) {
|
||||||
|
$scope.canAdd = canAdd;
|
||||||
|
});
|
||||||
|
|
||||||
$scope.parseType = 'yaml';
|
$scope.parseType = 'yaml';
|
||||||
$scope.formCancel = function(){
|
$scope.formCancel = function(){
|
||||||
$state.go('^');
|
$state.go('^');
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export default function() {
|
|||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
ngClick: 'formSave()', //$scope.function to call on click, optional
|
ngClick: 'formSave()', //$scope.function to call on click, optional
|
||||||
ngDisabled: 'custom_inventory_form.$pristine || custom_inventory_form.$invalid || !canEdit', //Disable when $pristine or $invalid, optional
|
ngDisabled: 'custom_inventory_form.$pristine || custom_inventory_form.$invalid', //Disable when $pristine or $invalid, optional
|
||||||
ngShow: '(inventory_script_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngShow: '(inventory_script_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user