feat: add security to endpoint
This commit is contained in:
parent
8feca848f2
commit
1a31a29680
2 changed files with 2 additions and 2 deletions
|
|
@ -231,7 +231,6 @@ export class PaymentFileController extends Controller {
|
|||
}
|
||||
|
||||
@Get("{name}")
|
||||
@Security("keycloak")
|
||||
async getAttachment(
|
||||
@Request() req: RequestWithUser,
|
||||
@Path() paymentId: string,
|
||||
|
|
|
|||
|
|
@ -842,13 +842,14 @@ export class QuotationFileController extends Controller {
|
|||
}
|
||||
|
||||
@Get("{name}")
|
||||
@Security("keycloak")
|
||||
async getAttachment(
|
||||
@Request() req: RequestWithUser,
|
||||
@Path() quotationId: string,
|
||||
@Path() name: string,
|
||||
) {
|
||||
await this.checkPermission(req.user, quotationId);
|
||||
return req.res?.redirect(await getFile(fileLocation.quotation.attachment(quotationId, name)));
|
||||
return await getFile(fileLocation.quotation.attachment(quotationId, name));
|
||||
}
|
||||
|
||||
@Put("{name}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue