import { HttpActionProperty, RequestWithUserOrAuth } from './types'; /** * Decorator for actions and classes. * @param Name of permission. Defaults to the name of the function */ export declare function Permission(name?: string): (target: any, funcName?: string) => void; /** Decorator for actions and classes. The user must be authenticated to have access */ export declare function Authorize(): (target: any, funcName?: string) => void; /** Decorator for actions and classes. No authentication required */ export declare function Public(): (target: any, funcName?: string) => void; export type PermCheckResult = { success: true; } | { success: false; reason: 'Unauthenticated' | 'Unauthorized'; }; export declare module PermCheckResult { function ok(): PermCheckResult; function unauthorized(): PermCheckResult; function unauthenticated(): PermCheckResult; } /** Internal helper */ export declare function setRoleMap(newRoleMap: Map): void; /** Internal helper: Generate permission checker function */ export declare function permCheckGenerator(target: any, actionFunc: HttpActionProperty): (req: RequestWithUserOrAuth) => Promise;