mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-25 20:47:54 +00:00
Add permission guards to controllers
This commit is contained in:
@@ -18,6 +18,7 @@ import { GetFloorChildDto } from '../dtos/get.floor.dto';
|
||||
import { UpdateFloorNameDto } from '../dtos/update.floor.dto';
|
||||
import { CheckBuildingTypeGuard } from 'src/guards/building.type.guard';
|
||||
import { CheckUserFloorGuard } from 'src/guards/user.floor.guard';
|
||||
import { FloorPermissionGuard } from 'src/guards/floor.permission.guard';
|
||||
|
||||
@ApiTags('Floor Module')
|
||||
@Controller({
|
||||
@@ -43,7 +44,7 @@ export class FloorController {
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@UseGuards(JwtAuthGuard, FloorPermissionGuard)
|
||||
@Get(':floorUuid')
|
||||
async getFloorByUuid(@Param('floorUuid') floorUuid: string) {
|
||||
try {
|
||||
@@ -58,7 +59,7 @@ export class FloorController {
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@UseGuards(JwtAuthGuard, FloorPermissionGuard)
|
||||
@Get('child/:floorUuid')
|
||||
async getFloorChildByUuid(
|
||||
@Param('floorUuid') floorUuid: string,
|
||||
@@ -78,7 +79,7 @@ export class FloorController {
|
||||
}
|
||||
}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@UseGuards(JwtAuthGuard, FloorPermissionGuard)
|
||||
@Get('parent/:floorUuid')
|
||||
async getFloorParentByUuid(@Param('floorUuid') floorUuid: string) {
|
||||
try {
|
||||
@@ -122,7 +123,7 @@ export class FloorController {
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@UseGuards(JwtAuthGuard, FloorPermissionGuard)
|
||||
@Put('rename/:floorUuid')
|
||||
async renameFloorByUuid(
|
||||
@Param('floorUuid') floorUuid: string,
|
||||
|
||||
Reference in New Issue
Block a user