1
0
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:
Jake McDermott 2018-11-06 00:31:10 -05:00
parent 3fef7acaa8
commit 5e4dd54112
No known key found for this signature in database
GPG Key ID: 9A6F084352C3A0B7
2 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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)">