Skip to content

Instantly share code, notes, and snippets.

View loicgeek's full-sized avatar

loic NGOU loicgeek

View GitHub Profile
@loicgeek
loicgeek / restful-crud-role.guard.ts
Created January 23, 2020 08:28 — forked from markpenaranda/restful-crud-role.guard.ts
NestJSX CRUD - restful role guard
import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common'
import { getAction } from '@nestjsx/crud'
@Injectable()
export class RestfulCrudRoleGuard implements CanActivate {
constructor(
// private readonly reflector: Reflector,
public restfulCrudOptions: {
readAllRoles: string [],