import { IRbacDescriptor } from './interfaces.js'; import { BasePolicy } from '@spinajs/http'; import { PermissionType } from '@spinajs/rbac'; import { Constructor } from '@spinajs/di'; /** * Global symbol so external packages (e.g. http-swagger) can read the RBAC * descriptor via Reflect metadata without importing rbac-http. */ export declare const ACL_CONTROLLER_DESCRIPTOR: unique symbol; export declare function setRbacMetadata(target: any, callback: (meta: IRbacDescriptor) => void): void; /** * Assign resource for controller * * @param resource - name of resource * @param permission - default permission. When omitted, the base controller's * permission is kept ( `readOwn` if there is nothing to * inherit ), so renaming a resource in a subclass does not * silently change what it grants. */ export declare function Resource(resource: string, permission?: PermissionType[]): any; /** * * Assigns permission for controller route * * `also` policies join `RbacPolicy` in the SAME policy group, so they are * combined with AND: the caller must pass the permission check and every extra * policy. Declaring them with a separate `@Policy()` would put them in their * own group, which `@spinajs/http` combines with OR at the same scope - and * `RbacPolicy` passing on its own would then be enough to open the route. * * @param permission - permission to set * @param also - additional policies this route requires alongside the permission check */ export declare function Permission(permission?: PermissionType[], ...also: Constructor[]): any; /** * Disables RbacModelPermissionMiddleware for controller action ( or whole controller when applied to class ). * * Use for actions that are assumed safe to execute - rbac permission * constraints will NOT be injected into query builders for queries * executed within the action. Route-level permission checks ( RbacPolicy ) * are NOT affected by this decorator. */ export declare function SkipModelPermission(): (target: any, propertyKey?: string | symbol, indexOrDescriptor?: number | PropertyDescriptor) => void; /** * Retrieves user from session if is logged in */ export declare function User(): (target: any, propertyKey?: string | symbol, indexOrDescriptor?: number | PropertyDescriptor) => void; /** * Extract args from user session */ export declare function FromSession(): (target: any, propertyKey?: string | symbol, indexOrDescriptor?: number | PropertyDescriptor) => void; export declare function Session(): (target: any, propertyKey?: string | symbol, indexOrDescriptor?: number | PropertyDescriptor) => void; /** * Verified session id from the session cookie, resolved under whatever name the * cookie is configured with. Prefer this over `@Cookie(true) ssid`, which ties * the read to the parameter name. */ export declare function SessionId(): (target: any, propertyKey?: string | symbol, indexOrDescriptor?: number | PropertyDescriptor) => void; //# sourceMappingURL=decorators.d.ts.map