export interface RoleVisibilityRole { readonly id: string; readonly key: string; readonly name: string; readonly description?: string | null; readonly isDefault: boolean; readonly tenantId?: string; readonly level?: number; readonly permissions: readonly string[]; } export interface RoleVisibilityContext { readonly appName: string; readonly tenantId?: string; readonly applicationId?: string; /** Viewer role IDs from `contextOptions.currentUserRoles` or the loaded user; `null` when unknown. Set `currentUserRoles` to include group-derived roles the loaded user lacks */ readonly viewerRoleIds: readonly string[] | null; /** All roles loaded for the active tenant, before filtering */ readonly roles: readonly RoleVisibilityRole[]; } /** Synchronous and pure; only a literal `true` shows the role, any other result or a thrown error hides it */ export type RoleVisibilityPredicate = (role: RoleVisibilityRole, context: RoleVisibilityContext) => boolean;