groups: add events to eventlog

This commit is contained in:
Girish Ramakrishnan
2024-12-04 09:48:25 +01:00
parent fdf8025a02
commit 3b9d617e37
13 changed files with 113 additions and 94 deletions
+1 -1
View File
@@ -193,7 +193,7 @@ async function setLocalGroups(req, res, next) {
if (req.body.groupIds.some((gid) => typeof gid !== 'string')) return next(new HttpError(400, 'groupIds array must contain strings'));
if (users.compareRoles(req.user.role, req.resource.role) < 0) return next(new HttpError(403, `role '${req.resource.role}' is required but user has only '${req.user.role}'`));
const [error] = await safe(groups.setLocalMembership(req.resource, req.body.groupIds));
const [error] = await safe(groups.setLocalMembership(req.resource, req.body.groupIds, AuditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(204));