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 -1
View File
@@ -21,7 +21,7 @@ export const seedAdmin = async (dataSource: DataSource, logger: Logger) => {
const roleRepo = dataSource.getRepository(Role);
const userRepo = dataSource.getRepository(User);
const adminRole = await roleRepo.findOneBy({ name: RoleEnum.ADMIN });
const adminRole = await roleRepo.findOneBy({ name: RoleEnum.SUPER_ADMIN });
if (!adminRole) throw new Error("Role not found");
const hashedPassword = await hash(defaultAdmin.password!, 10);