From 4923284e8b64372a265c22e574c52ef8e1ce5069 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Mon, 9 Oct 2023 11:36:15 +0200 Subject: [PATCH] :bug: Reintegrating condition on office roles --- src/app/api/super-admin/UsersController.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/api/super-admin/UsersController.ts b/src/app/api/super-admin/UsersController.ts index bacb7850..a4a63b51 100644 --- a/src/app/api/super-admin/UsersController.ts +++ b/src/app/api/super-admin/UsersController.ts @@ -128,11 +128,10 @@ export default class UsersController extends ApiController { return; } - // Not needed if you're super admin you can assign every roles from every offices - // if (officeRole.office_uid != userFound.office_uid) { - // this.httpBadRequest(response, "Cannot assign an office role from another office"); - // return; - // } + if (officeRole.office_uid != userFound.office_uid) { + this.httpBadRequest(response, "Cannot assign an office role from another office"); + return; + } } //call service to get prisma entity