2024-08-26 13:46:54 +02:00
|
|
|
export type PermissionSection = "club" | "settings" | "user";
|
|
|
|
|
2024-08-26 17:56:07 +02:00
|
|
|
export type PermissionModule =
|
|
|
|
| "members"
|
|
|
|
| "calendar"
|
|
|
|
| "newsletter"
|
|
|
|
| "protocoll"
|
|
|
|
| "qualification"
|
|
|
|
| "award"
|
|
|
|
| "executive_position"
|
|
|
|
| "communication"
|
|
|
|
| "user"
|
|
|
|
| "role";
|
2024-08-26 13:46:54 +02:00
|
|
|
|
|
|
|
export type PermissionType = "create" | "read" | "update" | "delete";
|
|
|
|
|
|
|
|
export type PermissionString =
|
|
|
|
| `${PermissionSection}.${PermissionModule}.${PermissionType}` // für spezifische Berechtigungen
|
|
|
|
| `${PermissionSection}.${PermissionModule}.*` // für alle Berechtigungen in einem Modul
|
|
|
|
| `${PermissionSection}.${PermissionType}` // für spezifische Berechtigungen in einem Abschnitt
|
|
|
|
| `${PermissionSection}.*` // für alle Berechtigungen in einem Abschnitt
|
|
|
|
| "*"; // für Admin
|
|
|
|
|
|
|
|
export type PermissionObject = {
|
|
|
|
[section in PermissionSection]?: {
|
|
|
|
[module in PermissionModule]?: Array<PermissionType> | "*";
|
|
|
|
} & { all?: PermissionType | "*" };
|
|
|
|
} & {
|
|
|
|
admin?: boolean;
|
|
|
|
};
|