Added a permission to control which users can access private attachments.

This commit is contained in:
Jan Böhmer 2020-03-30 16:56:58 +02:00
parent 9769915b34
commit e83d72ec10
7 changed files with 31 additions and 9 deletions

View file

@ -69,6 +69,10 @@ class AttachmentFileController extends AbstractController
{
$this->denyAccessUnlessGranted('read', $attachment);
if ($attachment->isSecure()) {
$this->denyAccessUnlessGranted('show_private', $attachment);
}
if ($attachment->isExternal()) {
throw new RuntimeException('You can not download external attachments!');
}
@ -97,6 +101,10 @@ class AttachmentFileController extends AbstractController
{
$this->denyAccessUnlessGranted('read', $attachment);
if ($attachment->isSecure()) {
$this->denyAccessUnlessGranted('show_private', $attachment);
}
if ($attachment->isExternal()) {
throw new RuntimeException('You can not download external attachments!');
}