Skip to content

Commit

Permalink
fix: add members button in group settings
Browse files Browse the repository at this point in the history
  • Loading branch information
vikrantgravitee committed Jan 27, 2025
1 parent 4fda059 commit 3dea012
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ const GroupComponentAjs: ng.IComponentOptions = {
.then(([groupsResponse, apiRolesResponse, applicationRolesResponse, integrationRolesResponse, invitationsResponse]) => {
this.group = groupsResponse.data;
this.isReadonly = this.group.origin === 'KUBERNETES';

/*
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.integrationRoles = [{ scope: 'INTEGRATION', name: '', system: false }].concat(integrationRolesResponse);
Expand Down Expand Up @@ -129,17 +141,6 @@ const GroupComponentAjs: ng.IComponentOptions = {
this.canChangeDefaultApplicationRole = this.isSuperAdmin || !this.group.lock_application_role;
this.canChangeDefaultIntegrationRole = this.isSuperAdmin;

/*
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();
};

Expand Down

0 comments on commit 3dea012

Please sign in to comment.