mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Merge pull request #5630 from jakemcdermott/fix-5586
Use summary `object_roles` to lookup admin role id Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
commit
04576af6a5
@ -26,11 +26,9 @@ function($scope, $rootScope, ProcessErrors, GetBasePath, generateList,
|
||||
let notAdminAlreadyParams = {};
|
||||
|
||||
if ($scope.addType === 'Administrators') {
|
||||
Rest.setUrl(GetBasePath('organizations') + `${$state.params.organization_id}/object_roles`);
|
||||
Rest.setUrl(GetBasePath('organizations') + `${$state.params.organization_id}`);
|
||||
Rest.get().then(({data}) => {
|
||||
notAdminAlreadyParams.not__roles = data.results
|
||||
.filter(({name}) => name === i18n._('Admin'))
|
||||
.map(({id}) => id)[0];
|
||||
notAdminAlreadyParams.not__roles = data.summary_fields.object_roles.admin_role.id;
|
||||
init();
|
||||
});
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user