import * as express from 'express'; export interface AdvancedControllerSettings { /** To specify a route for your controller(s). NOTE that namespaces are not included in whiteLists. */ namespace?: string; /** Log the registration of the controller */ debugLogger?: (message: string, meta?: any) => void; /** Log the errors of the controller during runtime */ errorLogger?: (message: string, meta?: any) => void; /** * Allow actions without explicit access specification? * (One of these: @Permission, @Authorize, @AllowAnonymus on the class or the action) * NOTE that this must be true if there is any access control (the upper decorators) in the application AND you want to use implicit access */ implicitAccess?: boolean; } export declare abstract class AdvancedController { private static controllers; private static roleMap; private static anyPermissionsCreated; /** Registers all AdvancedController instances created so far */ static registerAll(app: express.Express, settings?: AdvancedControllerSettings): void; /** * Returns the permissions of all AdvancedController instances created so far. */ static getAllPermissions(): string[]; /** * Returns the public routes of all AdvancedController instances created so far. * NOTE that this does not contain namespaces. */ static getAllPublicRoutes(): string[]; /** * Set roles for permission check. * Note that this will force role-based authorization, e.g. 'req.user.roles' must be a string array. * @param `roles`: Roles containing the permissions */ static setRoles(roles: { name: string; permissions: string[]; }[]): void; constructor(); /** Registers this controller */ register(app: express.Express, settings?: AdvancedControllerSettings): void; /** * Returns the permissions of this controller. */ getPermissions(): string[]; /** * Returns the public routes of this controller. * NOTE that this does not contain namespaces. */ getPublicRoutes(): string[]; }