diff --git a/awx/ui/client/src/forms/Credentials.js b/awx/ui/client/src/forms/Credentials.js index 4ebfa20170..1043327e84 100644 --- a/awx/ui/client/src/forms/Credentials.js +++ b/awx/ui/client/src/forms/Credentials.js @@ -43,8 +43,7 @@ export default ngDisabled: '!(credential_obj.summary_fields.user_capabilities.edit || canAdd)' }, organization: { - // interpolated with $rootScope - basePath: "{{$rootScope.current_user.is_superuser ? 'api/v1/organizations' : $rootScope.current_user.url + 'admin_of_organizations'}}", + basePath: 'organizations', ngShow: 'canShareCredential', label: i18n._('Organization'), type: 'lookup', diff --git a/awx/ui/client/src/shared/stateDefinitions.factory.js b/awx/ui/client/src/shared/stateDefinitions.factory.js index db3969d760..8279173dc9 100644 --- a/awx/ui/client/src/shared/stateDefinitions.factory.js +++ b/awx/ui/client/src/shared/stateDefinitions.factory.js @@ -686,10 +686,10 @@ export default ['$injector', '$stateExtender', '$log', function($injector, $stat interpolator = $interpolate(list.basePath); 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" 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`]); }