import { HttpException } from "@nestjs/common"; /** * Thrown when a principal lacks the required permission to perform an action. * * Returns HTTP 403 Forbidden. The required permissions, principal identifier, * and principal's current permissions are available on the exception for * server-side logging/auditing. * * @example * ```typescript * try { * permissionService.requirePermission(user, 'delete:users') * } catch (error) { * if (error instanceof PermissionDeniedException) { * this.logger.warn(`Permission denied for ${error.identifier}`, { * required: error.requiredPermissions, * had: error.permissions, * }) * } * } * ``` */ export declare class PermissionDeniedException extends HttpException { readonly requiredPermissions: string[]; readonly mode: "all" | "any"; readonly identifier?: any | undefined; readonly permissions?: string[] | undefined; /** * @param requiredPermissions - The permissions that were required but not granted * @param mode - Whether all permissions were required ("all") or any one of them ("any") * @param identifier - The identifier of the principal who was denied, for logging * @param permissions - The permissions the principal had at the time, for logging */ constructor(requiredPermissions: string[], mode: "all" | "any", identifier?: any | undefined, permissions?: string[] | undefined); /** * Returns the error response body. * * @returns Object containing statusCode (403), message, requiredPermissions, and permissions */ getResponse(): Record; }