From 875666b6e61ae24db950173454105cac7a66b48e Mon Sep 17 00:00:00 2001 From: L4168 <L4168@student.jamk.fi> Date: Thu, 27 Jun 2019 14:51:48 +0300 Subject: [PATCH] added roles auth --- src/task/task.controller.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/task/task.controller.ts b/src/task/task.controller.ts index 2e04789..32766ff 100644 --- a/src/task/task.controller.ts +++ b/src/task/task.controller.ts @@ -37,8 +37,10 @@ export class TaskController { return this.taskService.editTask(data); } + // lists all the tasks for the game if user has game_person entry + // :id is the id of the game @Get('get-tasks/:id') - @UseGuards(new AuthGuard()) + @Roles('soldier', 'factionleader', 'admin') async fetchTasks(@User('id') person, @Param('id') id: string) { return this.taskService.fetchTasks(person, id); } -- GitLab