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 c18d57f commit 9a823be
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
};

Expand Down

0 comments on commit 9a823be

Please sign in to comment.