Use board permissions to be applied for the shares

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2021-01-04 22:05:44 +01:00
parent 0c6dfb2442
commit 79468e6f06
4 changed files with 25 additions and 6 deletions

View File

@@ -132,6 +132,7 @@ class FilesAppService implements IAttachmentService, ICustomAttachmentService {
'mimetype' => $file->getMimeType(),
'info' => pathinfo($file->getName()),
'hasPreview' => $this->preview->isAvailable($file),
'permissions' => $share->getPermissions(),
]);
return $attachment;
}
@@ -170,7 +171,11 @@ class FilesAppService implements IAttachmentService, ICustomAttachmentService {
$fileName = $file['name'];
$userFolder = $this->rootFolder->getUserFolder($this->userId);
$folder = $userFolder->get($this->configService->getAttachmentFolder());
try {
$folder = $userFolder->get($this->configService->getAttachmentFolder());
} catch (NotFoundException $e) {
$folder = $userFolder->newFolder($this->configService->getAttachmentFolder());
}
$fileName = $folder->getNonExistingName($fileName);
$target = $folder->newFile($fileName);