import { Injector } from '@angular/core'; import { Dictionary, PromiseOr } from '@jscrpt/common'; /** * Extended type with authorization permission definition */ export interface AuthorizationDecoratedComponent { /** * Definition of permissions required for authorization for all routes */ permissions?: AuthorizeOptions; /** * Route specific permissions, can be applied only for specific route, overrides `permissions` */ routeSpecificPermissions?: Dictionary; } /** * Options passed to `Authorize` decorator */ export interface AuthorizeOptions { /** * Name of permission or array of permissions that is requested for displaying component */ permission: string | string[]; /** * Indication that AND condition should be used instead of OR condition if multiple permissions are provided */ andCondition?: boolean; /** * Indication that provided string is set of loggical operations among permission names, if this is true andCondition is ignored */ conditionString?: boolean; /** * Callback for additional condition that is added to evaluation of permission */ addCondition?: (injector: Injector) => PromiseOr; } /** * Used for setting required permission name for authentication * @param permission - Name of requested permission, array of permission names or AuthorizeOptions that is used for displaying of component * @param route - If provided route specific permission will be created applied only to specified route */ export declare function Authorize(permission: string | string[] | AuthorizeOptions, route?: string): (target: TFunction) => TFunction; //# sourceMappingURL=authorize.decorator.d.ts.map