diff --git a/web/backend/src/controllers/users.ts b/web/backend/src/controllers/users.ts index 5951782d..a2fab538 100644 --- a/web/backend/src/controllers/users.ts +++ b/web/backend/src/controllers/users.ts @@ -44,7 +44,7 @@ usersRouter.post('/add_role', (req, res, next) => { if ('userId' in req.body) { try { readSCIPER(req.body.userId); - addPolicy(req.body.userId, req.body.subject, req.body.permission); + await addPolicy(req.body.userId, req.body.subject, req.body.permission); } catch (error) { res.status(400).send(`Error while adding single user to roles: ${error}`); return; @@ -54,7 +54,7 @@ usersRouter.post('/add_role', (req, res, next) => { } else if ('userIds' in req.body) { try { req.body.userIds.every(readSCIPER); - addListPolicy(req.body.userIds, req.body.subject, req.body.permission); + await addListPolicy(req.body.userIds, req.body.subject, req.body.permission); } catch (error) { res.status(400).send(`Error while adding multiple users to roles: ${error}`); return;