feat (rbac): implement role-based access control

This commit is contained in:
Abizrh
2025-08-12 11:32:36 +07:00
parent 59db7a8479
commit 125d7857ce
16 changed files with 394 additions and 22 deletions
+22
View File
@@ -0,0 +1,22 @@
import type { PAGE_PERMISSIONS } from '~/lib/page-permission'
export interface User {
id: string
name: string
email: string
}
export interface AuthState {
user: User | null
roles: string[]
token: string | null
}
export type Permission = 'C' | 'R' | 'U' | 'D'
export interface RoleAccess {
[role: string]: Permission[]
}
export type PagePath = keyof typeof PAGE_PERMISSIONS
export type PagePermission = (typeof PAGE_PERMISSIONS)[PagePath]