Super admin can manage office roles

This commit is contained in:
Maxime Lalo 2023-10-09 11:08:27 +02:00
parent 4860a95209
commit 294fc3fd9f

View File

@ -127,10 +127,12 @@ export default class UsersController extends ApiController {
this.httpBadRequest(response, "Office role not found");
return;
}
if (officeRole.office_uid != userFound.office_uid) {
this.httpBadRequest(response, "Cannot assign an office role from another office");
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;
// }
}
//call service to get prisma entity