feat: implement role-based access control (RBAC) management system with Keycloak integration and dynamic page permission configuration

This commit is contained in:
Fanrouver
2026-07-14 09:41:55 +07:00
parent a5d7338e58
commit 49e0ee2bc4
14 changed files with 737 additions and 163 deletions

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
import { z } from 'zod';
export const hakAksesMenuSchema = z.object({
menuKey: z.string().min(1, "menuKey is required"),
name: z.string().min(1, "name is required"),
canAccess: z.boolean().default(false),
canView: z.boolean().default(false),
canAdd: z.boolean().default(false),
canEdit: z.boolean().default(false),
canDelete: z.boolean().default(false),
});
export const hakAksesPayloadSchema = z.object({
id: z.string().optional(),
role: z.string().optional(),
group: z.string().optional(),
namaTipeUser: z.string().optional(),
isGroupBased: z.boolean().default(true),
status: z.string().optional(), // Tambahan dari mock lama
namaHakAkses: z.string().optional(), // Tambahan dari mock lama
hakAksesMenu: z.array(hakAksesMenuSchema).default([]),
});
export type HakAksesMenu = z.infer<typeof hakAksesMenuSchema>;
export type HakAksesPayload = z.infer<typeof hakAksesPayloadSchema>;