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({ new ProjectAccessAddedEvent({
createdBy: 'some@email.com', createdBy: 'some@email.com',
data: { data: {
groups: [ roles: [
{ {
name: 'test', roleId: 1,
project: 'default', groupIds: [1, 2],
users: [{ username: testUsername }], users: [1],
}, },
], ],
}, },

View File

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