added all roles
This commit is contained in:
@@ -1,18 +1,23 @@
|
||||
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
|
||||
import { CostoService } from './costo.service';
|
||||
import { JwtAuthGuard } from 'src/user/jwt.guard';
|
||||
import { RolesGuard } from 'src/roles.guard';
|
||||
import { Role } from 'src/role.enum';
|
||||
import { Roles } from 'src/roles.decorator';
|
||||
|
||||
@Controller('costo')
|
||||
export class CostoController {
|
||||
constructor(private readonly costoService: CostoService) { }
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR,Role.ATENCION_USUARIOS,Role.SERVICIO_SOCIAL,Role.PCPUMA)
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.costoService.findAll();
|
||||
}
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@UseGuards(JwtAuthGuard, RolesGuard)
|
||||
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR)
|
||||
@Get('/:id_servicio')
|
||||
find(@Param('id_servicio') id_servicio: number) {
|
||||
return this.costoService.find(id_servicio);
|
||||
|
||||
Reference in New Issue
Block a user