1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-05 17:53:12 +02:00

chore: pick all roles

This commit is contained in:
Gastón Fournier 2024-06-18 10:06:22 +02:00
parent 1f4126e495
commit 3d4dd30cb9
No known key found for this signature in database
GPG Key ID: AF45428626E17A8E

View File

@ -901,10 +901,19 @@ export default class ProjectService {
newRoles: number[],
auditUser: IAuditUser,
): Promise<void> {
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,
);