mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 11:27:36 -02:30
Fix for filtering organizations, and fixing the org lookup on credentials form
This commit is contained in:
@@ -43,8 +43,7 @@ export default
|
|||||||
ngDisabled: '!(credential_obj.summary_fields.user_capabilities.edit || canAdd)'
|
ngDisabled: '!(credential_obj.summary_fields.user_capabilities.edit || canAdd)'
|
||||||
},
|
},
|
||||||
organization: {
|
organization: {
|
||||||
// interpolated with $rootScope
|
basePath: 'organizations',
|
||||||
basePath: "{{$rootScope.current_user.is_superuser ? 'api/v1/organizations' : $rootScope.current_user.url + 'admin_of_organizations'}}",
|
|
||||||
ngShow: 'canShareCredential',
|
ngShow: 'canShareCredential',
|
||||||
label: i18n._('Organization'),
|
label: i18n._('Organization'),
|
||||||
type: 'lookup',
|
type: 'lookup',
|
||||||
|
|||||||
@@ -686,10 +686,10 @@ export default ['$injector', '$stateExtender', '$log', function($injector, $stat
|
|||||||
interpolator = $interpolate(list.basePath);
|
interpolator = $interpolate(list.basePath);
|
||||||
path = interpolator({ $rootScope: $rootScope, $stateParams: $stateParams });
|
path = interpolator({ $rootScope: $rootScope, $stateParams: $stateParams });
|
||||||
}
|
}
|
||||||
// Need to delete the role_level here b/c organizations and inventory scripts
|
// Need to change the role_level here b/c organizations and inventory scripts
|
||||||
// don't have a "use_role", only "admin_role" and "read_role"
|
// don't have a "use_role", only "admin_role" and "read_role"
|
||||||
if(list.iterator === "organization" || list.iterator === "inventory_script"){
|
if(list.iterator === "organization" || list.iterator === "inventory_script"){
|
||||||
delete $stateParams[`${list.iterator}_search`].role_level;
|
$stateParams[`${list.iterator}_search`].role_level = "admin_role";
|
||||||
}
|
}
|
||||||
return qs.search(path, $stateParams[`${list.iterator}_search`]);
|
return qs.search(path, $stateParams[`${list.iterator}_search`]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user