Skip to content

Commit e760262

Browse files
committed
chore: Action performed audit log to happen after action
1 parent bbd7da6 commit e760262

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ee/packages/abac/src/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,13 +636,12 @@ export class AbacService extends ServiceClass implements IAbacService {
636636
const userRemovalPromises = [];
637637
for await (const doc of cursor) {
638638
usersToRemove.push(doc._id);
639-
void Audit.actionPerformed({ _id: doc._id, username: doc.username }, { _id: rid }, 'room-attributes-change');
640639
userRemovalPromises.push(
641640
limit(() =>
642641
Room.removeUserFromRoom(rid, doc, {
643642
skipAppPreEvents: true,
644643
customSystemMessage: 'abac-removed-user-from-room' as const,
645-
}),
644+
}).then(() => void Audit.actionPerformed({ _id: doc._id, username: doc.username }, { _id: rid }, 'room-attributes-change')),
646645
),
647646
);
648647
}
@@ -681,13 +680,12 @@ export class AbacService extends ServiceClass implements IAbacService {
681680

682681
const removalPromises: Promise<void>[] = [];
683682
for await (const room of cursor) {
684-
void Audit.actionPerformed({ _id: user._id, username: user.username }, { _id: room._id }, 'ldap-sync');
685683
removalPromises.push(
686684
limit(() =>
687685
Room.removeUserFromRoom(room._id, user, {
688686
skipAppPreEvents: true,
689687
customSystemMessage: 'abac-removed-user-from-room' as const,
690-
}),
688+
}).then(() => void Audit.actionPerformed({ _id: user._id, username: user.username }, { _id: room._id }, 'ldap-sync')),
691689
),
692690
);
693691
}

0 commit comments

Comments
 (0)