From 3d4dd30cb93f5b2ebb4a5b0e21896f42f9dd9195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Tue, 18 Jun 2024 10:06:22 +0200 Subject: [PATCH] chore: pick all roles --- src/lib/features/project/project-service.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/features/project/project-service.ts b/src/lib/features/project/project-service.ts index 0a9ce5721b..289a6a88df 100644 --- a/src/lib/features/project/project-service.ts +++ b/src/lib/features/project/project-service.ts @@ -901,10 +901,19 @@ export default class ProjectService { newRoles: number[], auditUser: IAuditUser, ): Promise { - const currentRoles = await this.accessService.getProjectRolesForUser( + let currentRoles = await this.accessService.getProjectRolesForUser( projectId, userId, ); + const groups = await this.groupService.getGroupsForUser(userId); + for (const group of groups) { + currentRoles = currentRoles.concat( + await this.accessService.getProjectRolesForGroup( + projectId, + group.id, + ), + ); + } const ownerRole = await this.accessService.getRoleByName( RoleName.OWNER, );