refactor: the whole role and permission flow

This commit is contained in:
mahyargdz
2025-02-17 13:54:34 +03:30
parent ad673613d9
commit 763b6b49d9
42 changed files with 479 additions and 387 deletions
@@ -1,7 +0,0 @@
import { Role } from "../../users/entities/role.entity";
import { RoleEnum } from "../../users/enums/role.enum";
export function checkUserRole(userRoles: Role[], requiredRole: RoleEnum) {
if (!userRoles.some((role) => role.name === requiredRole)) return false;
return true;
}