Move auth config and build admin menus

Extract NextAuth configuration into a shared library, load admin sidebar items from role permissions, and update related RBAC types and UI.
This commit is contained in:
Ichsan Kurniawan
2026-11-06 18:25:54 +07:00
parent b149903b2e
commit 7f8e6637e4
38 changed files with 406 additions and 239 deletions
+4 -1
View File
@@ -19,18 +19,21 @@ declare module 'next-auth' {
company?: ICompany
division?: IDivision
role: {
id: number
code: string
name: string
allow_admin_panel: boolean
role_detail?: {
action: string[]
menu: {
id: number
code: string
name: string
menu_parent_id: number
icon: string
path_url: string
sort: number
hidden_data: boolean
is_admin_menu: boolean
}
}[]
}
+8 -1
View File
@@ -21,13 +21,21 @@ export interface IMenu {
is_admin_menu: boolean;
menu_parent_id?: number | null;
action?: string[];
status_id?: number
status?: {
id?: number;
code?: string;
name?: string;
};
sort: number
children?: IMenu[];
menu_level?: number;
"created_at"?: string
"created_by"?: number
"updated_at"?: string
"updated_by"?: 1
"deleted_at"?: string
"deleted_by"?: number
}
export interface IRoleDetail {
@@ -48,7 +56,6 @@ export interface IRole {
description?: string;
allow_admin_panel?: boolean;
role_detail?: IRoleDetail[];
privilege?: any[];
status?: {
id?: number;
code?: string;