File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export class DistributionCenterGuard extends AuthGuard('jwt') {
13
13
async canActivate ( context : ExecutionContext ) : Promise < boolean > {
14
14
await super . canActivate ( context ) ;
15
15
const ok = await canActivate ( context , [
16
- AccessLevel . Admin ,
16
+ AccessLevel . Staff ,
17
17
AccessLevel . DistributionCenter ,
18
18
] ) ;
19
19
if ( ok ) return true ;
Original file line number Diff line number Diff line change @@ -7,11 +7,13 @@ import {
7
7
Param ,
8
8
Post ,
9
9
Put ,
10
+ UseGuards ,
10
11
} from '@nestjs/common' ;
11
12
import { ApiTags } from '@nestjs/swagger' ;
12
13
13
14
import { ShelterSupplyService } from './shelter-supply.service' ;
14
15
import { ServerResponse } from '../utils' ;
16
+ import { DistributionCenterGuard } from '@/guards/distribution-center.guard' ;
15
17
16
18
@ApiTags ( 'Suprimento de abrigos' )
17
19
@Controller ( 'shelter/supplies' )
@@ -69,6 +71,7 @@ export class ShelterSupplyController {
69
71
}
70
72
71
73
@Put ( ':shelterId/supplies/many' )
74
+ @UseGuards ( DistributionCenterGuard )
72
75
async updateMany ( @Body ( ) body , @Param ( 'shelterId' ) shelterId : string ) {
73
76
try {
74
77
const data = await this . shelterSupplyService . updateMany ( {
You can’t perform that action at this time.
0 commit comments