Skip to content

Commit

Permalink
Fix accessing the request in a component
Browse files Browse the repository at this point in the history
  • Loading branch information
felixkempf committed Jul 10, 2019
1 parent b3c1121 commit 76c2124
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Controller/Component/AttachmentsComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function assertDownloadAuthorization(Attachment $attachment): void
$behaviorConfig = $attachmentsBehavior->config();
if (is_callable($behaviorConfig['downloadAuthorizeCallback'])) {
$relatedEntity = $attachment->getRelatedEntity();
$authorized = $behaviorConfig['downloadAuthorizeCallback']($attachment, $relatedEntity, $this->getRequest());
$authorized = $behaviorConfig['downloadAuthorizeCallback']($attachment, $relatedEntity, $this->getController()->getRequest());
if ($authorized !== true) {
throw new UnauthorizedException(__d('attachments', 'attachments.unauthorized_for_attachment_download'));
}
Expand Down

0 comments on commit 76c2124

Please sign in to comment.