mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
disable playbook when permission denied to list
This commit is contained in:
parent
a467d20341
commit
50970f2c31
@ -121,7 +121,7 @@ export default
|
||||
label: i18n._('Playbook'),
|
||||
type:'select',
|
||||
ngOptions: 'book for book in playbook_options track by book',
|
||||
ngDisabled: "(job_type.value === 'scan' && project_name === 'Default') || !(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)",
|
||||
ngDisabled: "(job_type.value === 'scan' && project_name === 'Default') || !(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate) || disablePlaybookBecausePermissionDenied",
|
||||
id: 'playbook-select',
|
||||
awRequiredWhen: {
|
||||
reqExpression: "playbookrequired",
|
||||
|
||||
@ -98,6 +98,7 @@ export default
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function (data) {
|
||||
$scope.disablePlaybookBecausePermissionDenied = false;
|
||||
$scope.playbook_options = [];
|
||||
var playbookNotFound = true;
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
@ -118,6 +119,7 @@ export default
|
||||
.error(function (ret,status_code) {
|
||||
if (status_code === 403) {
|
||||
/* user doesn't have access to see the project, no big deal. */
|
||||
$scope.disablePlaybookBecausePermissionDenied = true;
|
||||
} else {
|
||||
Alert('Missing Playbooks', 'Unable to retrieve the list of playbooks for this project. Choose a different ' +
|
||||
' project or make the playbooks available on the file system.', 'alert-info');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user