1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-27 11:02:16 +01:00

chore: list users and groups under each role in projectaccessadded event

This commit is contained in:
David Leek 2023-12-11 08:38:49 +01:00
parent 9508c79451
commit e67c20d8bb
No known key found for this signature in database
GPG Key ID: 515EE0F1BB6D0BE1
2 changed files with 16 additions and 10 deletions

View File

@ -116,11 +116,11 @@ test('should anonymise any PII fields, no matter the depth', async () => {
new ProjectAccessAddedEvent({
createdBy: 'some@email.com',
data: {
groups: [
roles: [
{
name: 'test',
project: 'default',
users: [{ username: testUsername }],
roleId: 1,
groupIds: [1, 2],
users: [1],
},
],
},

View File

@ -661,9 +661,11 @@ export default class ProjectService {
project: projectId,
createdBy,
data: {
roles: {
roleId,
groups: usersAndGroups.groups.map(({ id }) => id),
users: usersAndGroups.users.map(({ id }) => id),
groupIds: usersAndGroups.groups.map(({ id }) => id),
userIds: usersAndGroups.users.map(({ id }) => id),
},
},
}),
);
@ -689,9 +691,13 @@ export default class ProjectService {
project: projectId,
createdBy,
data: {
roles,
groups,
users,
roles: roles.map((roleId) => {
return {
roleId,
groupIds: groups,
userIds: users,
};
}),
},
}),
);