nest-access-control
Version:
Access Control Module For Nestjs Framework
9 lines (8 loc) • 552 B
TypeScript
/**
* Access the user roles from the request object i.e `req.user.roles`.
*
* You can pass an optional property key to the decorator to get it from the user object
* e.g `@UserRoles('permissions')` will return the `req.user.permissions` instead.
* In case that the request is missing User object the function will return null
*/
export declare const UserRoles: (...dataOrPipes: (string | import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;