added all roles
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
import { Controller, Get, UseGuards } from '@nestjs/common';
|
||||
import { ServicioService } from './servicio.service';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
import { RolesGuard } from 'src/roles.guard';
|
||||
import { Roles } from 'src/roles.decorator';
|
||||
import { Role } from 'src/role.enum';
|
||||
|
||||
@Controller('servicio')
|
||||
export class ServicioController {
|
||||
constructor(private readonly servicioService: ServicioService) {}
|
||||
constructor(private readonly servicioService: ServicioService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR)
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.servicioService.findAll();
|
||||
|
||||
Reference in New Issue
Block a user