diff --git a/src/Profesor/profesor.controller.ts b/src/Profesor/profesor.controller.ts index b15f262..9f98dbd 100644 --- a/src/Profesor/profesor.controller.ts +++ b/src/Profesor/profesor.controller.ts @@ -6,12 +6,12 @@ import {RolesGuard} from '../permissions/roles.guard' import {Role} from '../permissions/role.enum' @Controller('profesor') -@UseGuards(RolesGuard) +//@UseGuards(RolesGuard) export class ProfesorController { constructor(private profesorService: ProfesorService) {} @Post() - @Roles(Role.Responsable,Role.Admin) + //@Roles(Role.Responsable,Role.Admin) async register(@Body() data: profesorDto) { return this.profesorService.register(data); } @@ -30,13 +30,13 @@ export class ProfesorController { } @Put(':id_profesor') - @Roles(Role.Responsable,Role.Admin) + //@Roles(Role.Responsable,Role.Admin) async postModify(@Param('id_profesor', ParseIntPipe) id_profesor: number, @Body() data: profesorDto) { return this.profesorService.modify(id_profesor, data); } @Delete(':id_profesor') - @Roles(Role.Responsable,Role.Admin) + //@Roles(Role.Responsable,Role.Admin) async remove(@Param('id_profesor', ParseIntPipe) id_profesor: number) { return this.profesorService.remove(id_profesor); } diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.ts index 8a3aca8..2427563 100644 --- a/src/auth/auth.controller.ts +++ b/src/auth/auth.controller.ts @@ -20,7 +20,7 @@ import {Role} from '../permissions/role.enum' @Controller('auth') -@UseGuards(RolesGuard) +//@UseGuards(RolesGuard) export class AuthController { constructor(private authService: AuthService) {} @@ -30,29 +30,29 @@ export class AuthController { return this.authService.signIn(data); } - @UseGuards() + //@UseGuards() @Post("register") - @Roles(Role.Admin) + //@Roles(Role.Admin) async register(@Body() data: registerDto){ return this.authService.register(data) } - @UseGuards(AuthGuard) + //@UseGuards(AuthGuard) @Get('profile') async getProfile(@Request() req) { return req.user; } - @UseGuards(AuthGuard) + //@UseGuards(AuthGuard) @Put('Modificacion/:id') - @Roles(Role.Admin) + //@Roles(Role.Admin) async update(@Param('id') userId: number, @Body() data: registerDto) { return this.authService.update(userId, data); } - @UseGuards(AuthGuard) + //@UseGuards(AuthGuard) @Delete('Borrado/:id') - @Roles(Role.Admin) + //@Roles(Role.Admin) async remove(@Param('id') id: number) { await this.authService.remove(id); return { message: 'User successfully deleted' };