Skip to content

Instantly share code, notes, and snippets.

View markpenaranda's full-sized avatar

Mark Penaranda markpenaranda

View GitHub Profile
@markpenaranda
markpenaranda / restful-crud-role.guard.ts
Last active December 9, 2020 01:17
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 [],