mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 23:51:09 +03:00
remove admin and member roles from organization->team role assignment options
This commit is contained in:
parent
3fef7acaa8
commit
5e4dd54112
@ -27,6 +27,17 @@ export default ['$rootScope', '$scope', 'GetBasePath', 'Rest', '$q', 'Wait', 'Pr
|
|||||||
// array for all possible roles for the object
|
// array for all possible roles for the object
|
||||||
scope.roles = scope.object.summary_fields.object_roles;
|
scope.roles = scope.object.summary_fields.object_roles;
|
||||||
|
|
||||||
|
const objectType = _.get(scope, ['object', 'type']);
|
||||||
|
const teamRoles = _.get(scope, ['object', 'summary_fields', 'object_roles'], {});
|
||||||
|
|
||||||
|
if (objectType === 'organization') {
|
||||||
|
// some organization object_roles aren't allowed for teams
|
||||||
|
delete teamRoles.admin_role;
|
||||||
|
delete teamRoles.member_role;
|
||||||
|
}
|
||||||
|
|
||||||
|
scope.teamRoles = teamRoles;
|
||||||
|
|
||||||
// TODO: get working with api
|
// TODO: get working with api
|
||||||
// array w roles and descriptions for key
|
// array w roles and descriptions for key
|
||||||
scope.roleKey = Object
|
scope.roleKey = Object
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
{{ obj.type }}
|
{{ obj.type }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<rbac-multiselect-role class="AddPermissions-roleSelect" roles="roles" model="obj.roles">
|
<rbac-multiselect-role class="AddPermissions-roleSelect" roles="tab.teams ? teamRoles : roles" model="obj.roles">
|
||||||
</rbac-multiselect-role>
|
</rbac-multiselect-role>
|
||||||
<button class="AddPermissions-roleRemove"
|
<button class="AddPermissions-roleRemove"
|
||||||
ng-click="removeObject(obj)">
|
ng-click="removeObject(obj)">
|
||||||
|
Loading…
Reference in New Issue
Block a user