diff --git a/awx/ui/client/src/access/add-rbac-resource/rbac-resource.controller.js b/awx/ui/client/src/access/add-rbac-resource/rbac-resource.controller.js index 7c1ca5be35..5349ecd216 100644 --- a/awx/ui/client/src/access/add-rbac-resource/rbac-resource.controller.js +++ b/awx/ui/client/src/access/add-rbac-resource/rbac-resource.controller.js @@ -27,6 +27,17 @@ export default ['$rootScope', '$scope', 'GetBasePath', 'Rest', '$q', 'Wait', 'Pr // array for all possible roles for the object 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 // array w roles and descriptions for key scope.roleKey = Object diff --git a/awx/ui/client/src/access/add-rbac-resource/rbac-resource.partial.html b/awx/ui/client/src/access/add-rbac-resource/rbac-resource.partial.html index 61f83c679d..2ddfac5bc0 100644 --- a/awx/ui/client/src/access/add-rbac-resource/rbac-resource.partial.html +++ b/awx/ui/client/src/access/add-rbac-resource/rbac-resource.partial.html @@ -88,7 +88,7 @@ {{ obj.type }} - +