Skip to content
Permalink
Browse files

support version< 10.2

  • Loading branch information...
LinneyS committed Jun 5, 2019
1 parent fa182b8 commit b429d15aa40b8dac0fe19f3e424d5819a0c32e80
Showing with 29 additions and 27 deletions.
  1. +29 −27 controller/editorcontroller.php
@@ -499,40 +499,42 @@ public function config($fileId, $filePath = NULL, $token = NULL, $desktop = fals
$fileStorage = $file->getStorage();
if (empty($token) && $fileStorage->instanceOfStorage("\OCA\Files_Sharing\SharedStorage")) {
$share = $fileStorage->getShare();
if (method_exists($share, "getAttributes"))
{
$permissionsDownload = $share->getAttributes()->getAttribute("permissions", "download");
if ($permissionsDownload !== null) {
$params["document"]["permissions"]["download"] = $params["document"]["permissions"]["print"] = $permissionsDownload === true;
}
$permissionsDownload = $share->getAttributes()->getAttribute("permissions", "download");
if ($permissionsDownload !== null) {
$params["document"]["permissions"]["download"] = $params["document"]["permissions"]["print"] = $permissionsDownload === true;
}
if (isset($format["review"]) && $format["review"]) {
$permissionsReviewOnly = $share->getAttributes()->getAttribute($this->appName, "review");
if ($permissionsReviewOnly !== null && $permissionsReviewOnly === true) {
$restrictedEditing = true;
$params["document"]["permissions"]["review"] = true;
if (isset($format["review"]) && $format["review"]) {
$permissionsReviewOnly = $share->getAttributes()->getAttribute($this->appName, "review");
if ($permissionsReviewOnly !== null && $permissionsReviewOnly === true) {
$restrictedEditing = true;
$params["document"]["permissions"]["review"] = true;
}
}
}
if (isset($format["fillForms"]) && $format["fillForms"]) {
$permissionsFillFormsOnly = $share->getAttributes()->getAttribute($this->appName, "fillForms");
if ($permissionsFillFormsOnly !== null && $permissionsFillFormsOnly === true) {
$restrictedEditing = true;
$params["document"]["permissions"]["fillForms"] = true;
if (isset($format["fillForms"]) && $format["fillForms"]) {
$permissionsFillFormsOnly = $share->getAttributes()->getAttribute($this->appName, "fillForms");
if ($permissionsFillFormsOnly !== null && $permissionsFillFormsOnly === true) {
$restrictedEditing = true;
$params["document"]["permissions"]["fillForms"] = true;
}
}
}
if (isset($format["comment"]) && $format["comment"]) {
$permissionsCommentOnly = $share->getAttributes()->getAttribute($this->appName, "comment");
if ($permissionsCommentOnly !== null && $permissionsCommentOnly === true) {
$restrictedEditing = true;
$params["document"]["permissions"]["comment"] = true;
if (isset($format["comment"]) && $format["comment"]) {
$permissionsCommentOnly = $share->getAttributes()->getAttribute($this->appName, "comment");
if ($permissionsCommentOnly !== null && $permissionsCommentOnly === true) {
$restrictedEditing = true;
$params["document"]["permissions"]["comment"] = true;
}
}
}
if (isset($format["modifyFilter"]) && $format["modifyFilter"]) {
$permissionsModifyFilter = $share->getAttributes()->getAttribute($this->appName, "modifyFilter");
if ($permissionsModifyFilter !== null) {
$params["document"]["permissions"]["modifyFilter"] = $permissionsModifyFilter === true;
if (isset($format["modifyFilter"]) && $format["modifyFilter"]) {
$permissionsModifyFilter = $share->getAttributes()->getAttribute($this->appName, "modifyFilter");
if ($permissionsModifyFilter !== null) {
$params["document"]["permissions"]["modifyFilter"] = $permissionsModifyFilter === true;
}
}
}
}

0 comments on commit b429d15

Please sign in to comment.
You can’t perform that action at this time.