refactor permissions
This commit is contained in:
@@ -11,13 +11,13 @@ import { PermissionEnum } from "../../users/enums/permission.enum";
|
||||
|
||||
@AuthGuards()
|
||||
@AdminRoute()
|
||||
@PermissionsDec(PermissionEnum.TASK_PHASE)
|
||||
@ApiTags("Task Manager - Task Phases")
|
||||
@Controller("task-manager/task-phases")
|
||||
export class TaskPhaseController {
|
||||
constructor(private readonly taskPhaseService: TaskPhaseService) {}
|
||||
|
||||
@Post()
|
||||
@PermissionsDec(PermissionEnum.TASK_PHASE_CREATE)
|
||||
@ApiOperation({ summary: "Create a new task phase" })
|
||||
@ApiResponse({ status: 201, description: "TaskPhase created", type: TMTaskPhase })
|
||||
@ApiResponse({ status: 404, description: "Project not found" })
|
||||
@@ -26,6 +26,7 @@ export class TaskPhaseController {
|
||||
}
|
||||
|
||||
@Patch(":id")
|
||||
@PermissionsDec(PermissionEnum.TASK_PHASE_UPDATE)
|
||||
@ApiOperation({ summary: "Update a task phase" })
|
||||
@ApiParam({ name: "id", description: "TaskPhase ID" })
|
||||
@ApiResponse({ status: 200, description: "TaskPhase updated", type: TMTaskPhase })
|
||||
@@ -35,6 +36,7 @@ export class TaskPhaseController {
|
||||
}
|
||||
|
||||
@Delete(":id")
|
||||
@PermissionsDec(PermissionEnum.TASK_PHASE_DELETE)
|
||||
@ApiOperation({ summary: "Delete a task phase" })
|
||||
@ApiParam({ name: "id", description: "TaskPhase ID" })
|
||||
@ApiResponse({ status: 200, description: "TaskPhase deleted" })
|
||||
|
||||
Reference in New Issue
Block a user