Merge pull request #2587 from jakemcdermott/fix-2563

remove admin and member roles from team->organizations role assignment options

Reviewed-by: Alan Rominger <arominge@redhat.com>
             https://github.com/AlanCoding
This commit is contained in:
softwarefactory-project-zuul[bot] 2018-11-05 15:13:18 +00:00 committed by GitHub
commit 37def8cf7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,8 +77,17 @@ function(scope, $state, i18n, CreateSelect2, Rest, $q, Wait, ProcessErrors) {
// aggregate name/descriptions for each available role, based on resource type
// reasoning:
function aggregateKey(item, type){
_.merge(scope.keys[type], item.summary_fields.object_roles);
function aggregateKey(item, type) {
const ownerType = _.get(scope, ['owner', 'type']);
const { object_roles } = item.summary_fields;
if (ownerType === 'team' && type === 'organizations') {
// some organization object_roles aren't allowed for teams
delete object_roles.admin_role;
delete object_roles.member_role;
}
_.merge(scope.keys[type], object_roles);
}
scope.closeModal = function() {