Skip to content

Commit

Permalink
Merge pull request #738 from ONLYOFFICE/feature/nc-25
Browse files Browse the repository at this point in the history
Release/7.6.8
  • Loading branch information
LinneyS authored Nov 1, 2022
2 parents d42086c + 3be3fc4 commit 5631919
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 7.6.8
## Changed
- fix download permission

## 7.6.6
## Added
- Dutch translation
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>ONLYOFFICE connector allows you to view, edit and collaborate on text documents, spreadsheets and presentations within Nextcloud using ONLYOFFICE Docs. This will create a new Edit in ONLYOFFICE action within the document library for Office documents. This allows multiple users to co-author documents in real time from the familiar web interface and save the changes back to your file storage.</description>
<licence>apache</licence>
<author mail="dev@onlyoffice.com" homepage="https://www.onlyoffice.com/">Ascensio System SIA</author>
<version>7.6.6</version>
<version>7.6.8</version>
<namespace>Onlyoffice</namespace>
<types>
<prevent_group_restriction/>
Expand Down
3 changes: 2 additions & 1 deletion controller/editorapicontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ public function config($fileId, $filePath = null, $shareToken = null, $directTok
if (method_exists(IShare::class, "getAttributes")) {
$share = empty($share) ? $fileStorage->getShare() : $share;
$attributes = $share->getAttributes();
if ($attributes !== null && !$attributes->getAttribute("permissions", "download")) {
$downloadAttr = isset($attributes) ? $attributes->getAttribute("permissions", "download") : null;
if (isset($downloadAttr) && !$downloadAttr) {
$canDownload = false;
}
}
Expand Down
3 changes: 2 additions & 1 deletion controller/editorcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,8 @@ public function download($fileId, $toExtension = null, $template = false) {
if (method_exists(IShare::class, "getAttributes")) {
$share = empty($share) ? $fileStorage->getShare() : $share;
$attributes = $share->getAttributes();
if ($attributes !== null && !$attributes->getAttribute("permissions", "download")) {
$downloadAttr = isset($attributes) ? $attributes->getAttribute("permissions", "download") : null;
if (isset($downloadAttr) && !$downloadAttr) {
return $this->renderError($this->trans->t("Not permitted"));
}
}
Expand Down

0 comments on commit 5631919

Please sign in to comment.