Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[master] fix: add members button in group settings #10530

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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