mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
Added a permission to control which users can access private attachments.
This commit is contained in:
parent
9769915b34
commit
e83d72ec10
7 changed files with 31 additions and 9 deletions
|
@ -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!');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue