Skip to content

Commit 6db53d9

Browse files
fagundesjgfilipepacheco
authored andcommitted
wip
1 parent 4a08372 commit 6db53d9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/guards/distribution-center.guard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class DistributionCenterGuard extends AuthGuard('jwt') {
1313
async canActivate(context: ExecutionContext): Promise<boolean> {
1414
await super.canActivate(context);
1515
const ok = await canActivate(context, [
16-
AccessLevel.Admin,
16+
AccessLevel.Staff,
1717
AccessLevel.DistributionCenter,
1818
]);
1919
if (ok) return true;

src/shelter-supply/shelter-supply.controller.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ import {
77
Param,
88
Post,
99
Put,
10+
UseGuards,
1011
} from '@nestjs/common';
1112
import { ApiTags } from '@nestjs/swagger';
1213

1314
import { ShelterSupplyService } from './shelter-supply.service';
1415
import { ServerResponse } from '../utils';
16+
import { DistributionCenterGuard } from '@/guards/distribution-center.guard';
1517

1618
@ApiTags('Suprimento de abrigos')
1719
@Controller('shelter/supplies')
@@ -69,6 +71,7 @@ export class ShelterSupplyController {
6971
}
7072

7173
@Put(':shelterId/supplies/many')
74+
@UseGuards(DistributionCenterGuard)
7275
async updateMany(@Body() body, @Param('shelterId') shelterId: string) {
7376
try {
7477
const data = await this.shelterSupplyService.updateMany({

0 commit comments

Comments
 (0)