export type PermissionSection = "club" | "settings" | "user"; export type PermissionModule = "protocoll" | "user"; export type PermissionType = "read" | "create" | "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 | "*"; } & { all?: Array | "*" }; } & { admin?: boolean; }; export const permissionSections: Array = ["club", "settings", "user"]; export const permissionModules: Array = ["protocoll", "user"]; export const permissionTypes: Array = ["read", "create", "update", "delete"];