Skip to content

Commit d29513c

Browse files
kamiiiela-cordier
authored andcommitted
fix: make members read-only
see: https://gravitee.atlassian.net/browse/GKO-214
1 parent 7015cd0 commit d29513c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

gravitee-apim-console-webui/src/management/api/user-group-access/groups/api-general-groups.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { Api, Group } from '../../../../entities/management-api-v2';
2323
export interface ApiGroupsDialogData {
2424
api: Api;
2525
groups: Group[];
26+
isKubernetesOrigin?: boolean;
2627
}
2728
export interface ApiGroupsDialogResult {
2829
groups: string[];
@@ -40,6 +41,7 @@ export class ApiGeneralGroupsComponent implements OnInit {
4041
public groups: Group[];
4142
public readOnlyGroupList: string;
4243
public isV1Api = false;
44+
public isKubernetesOrigin = false;
4345

4446
constructor(
4547
private readonly permissionService: GioPermissionService,
@@ -50,10 +52,11 @@ export class ApiGeneralGroupsComponent implements OnInit {
5052
) {
5153
this.api = dialogData.api;
5254
this.groups = dialogData.groups;
55+
this.isKubernetesOrigin = dialogData.isKubernetesOrigin;
5356
}
5457

5558
ngOnInit() {
56-
this.isReadOnly = !this.permissionService.hasAnyMatching(['api-definition-u']);
59+
this.isReadOnly = this.isKubernetesOrigin || !this.permissionService.hasAnyMatching(['api-definition-u']);
5760
this.isV1Api = this.api.definitionVersion === 'V1';
5861

5962
const userGroupList: Group[] = this.groups.filter((group) => this.api.groups?.includes(group.id));

gravitee-apim-console-webui/src/management/api/user-group-access/members/api-general-members.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ export class ApiGeneralMembersComponent implements OnInit {
218218
data: {
219219
api: this.api,
220220
groups: this.groups,
221+
isKubernetesOrigin: this.isKubernetesOrigin,
221222
},
222223
})
223224
.afterClosed()
@@ -226,7 +227,7 @@ export class ApiGeneralMembersComponent implements OnInit {
226227
return combineLatest([of(apiDialogResult), this.apiService.get(this.activatedRoute.snapshot.params.apiId)]);
227228
}),
228229
switchMap(([apiDialogResult, api]) => {
229-
return api.definitionVersion === 'V1' || api.definitionVersion === 'FEDERATED' || this.isKubernetesOrigin
230+
return api.definitionVersion === 'V1' || api.definitionVersion === 'FEDERATED'
230231
? throwError({ message: `You cannot modify a ${api.definitionVersion} API.` })
231232
: this.apiService.update(api.id, { ...api, groups: apiDialogResult?.groups });
232233
}),

0 commit comments

Comments
 (0)