Skip to content

Instantly share code, notes, and snippets.

@ojhaujjwal
Last active June 10, 2020 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ojhaujjwal/3810d52e5117e76ff3b6951680ae90ce to your computer and use it in GitHub Desktop.
Save ojhaujjwal/3810d52e5117e76ff3b6951680ae90ce to your computer and use it in GitHub Desktop.
import { Controller, Get } from '@nestjs/common';
import { AuthenticationGuard, AccessControlGuard } from 'app/decorators';
@Controller({ path: '/admin/dashboard' })
@AuthenticationGuard()
@AccessControlGuard({ role: 'admin' })
export class AdminDashboardController {
@Get()
index(): string {
return 'dashboard data for admin';
}
}
@Controller({ path: '/admin/posts' })
@AuthenticationGuard()
@AccessControlGuard({ role: 'admin' })
export class AdminPostsController {
@Get()
findPaginated(): string {
return 'all posts for the page';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment