mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-04 22:45:56 +01:00
Added a permission to control which users can access private attachments.
This commit is contained in:
@@ -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!');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user