From 9a823be19597986c83c74eb9af2ba9cd2406f304 Mon Sep 17 00:00:00 2001 From: vikrant Date: Mon, 27 Jan 2025 09:40:36 +0530 Subject: [PATCH] fix: add members button in group settings --- .../groups/group/group.component.ajs.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/gravitee-apim-console-webui/src/management/settings/groups/group/group.component.ajs.ts b/gravitee-apim-console-webui/src/management/settings/groups/group/group.component.ajs.ts index 56ea839be55..e09f3848467 100644 --- a/gravitee-apim-console-webui/src/management/settings/groups/group/group.component.ajs.ts +++ b/gravitee-apim-console-webui/src/management/settings/groups/group/group.component.ajs.ts @@ -89,6 +89,18 @@ const GroupComponentAjs: ng.IComponentOptions = { ]) .then(([groupsResponse, apiRolesResponse, applicationRolesResponse, invitationsResponse]) => { this.group = groupsResponse.data; + + /* + It is written in the members list: "Enable email invitation and/or user search to allow the group administrator to add users." + It means that to add members, the group must be manageable (i.e. the current user is a group admin) and the group must have email invitation or system invitation enabled. + */ + /* + It is possible to add members only when a group is first created, otherwise we can't associate members to the group (without id) + */ + this.canAddMembers = + this.updateMode && + (this.isSuperAdmin || (this.group.manageable && (this.group.system_invitation || this.group.email_invitation))); + this.apiRoles = [{ scope: 'API', name: '', system: false }].concat(apiRolesResponse); this.applicationRoles = [{ scope: 'APPLICATION', name: '', system: false }].concat(applicationRolesResponse); this.invitations = invitationsResponse.data; @@ -123,17 +135,6 @@ const GroupComponentAjs: ng.IComponentOptions = { this.canChangeDefaultApiRole = this.isSuperAdmin || !this.group.lock_api_role; this.canChangeDefaultApplicationRole = this.isSuperAdmin || !this.group.lock_application_role; - /* - It is written in the members list: "Enable email invitation and/or user search to allow the group administrator to add users." - It means that to add members, the group must be manageable (i.e. the current user is a group admin) and the group must have email invitation or system invitation enabled. - */ - /* - It is possible to add members only when a group is first created, otherwise we can't associate members to the group (without id) - */ - this.canAddMembers = - this.updateMode && - (this.isSuperAdmin || (this.group.manageable && (this.group.system_invitation || this.group.email_invitation))); - this.loadGroupApis(); };