✨ feat (rbac): implement role-based access control
This commit is contained in:
@@ -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]
|
||||
Reference in New Issue
Block a user