diff options
author | Sergey Linnik <sergey.linnik@onlyoffice.com> | 2021-06-11 13:30:16 +0300 |
---|---|---|
committer | Antipkin-A <Artem.Antipkin@onlyoffice.com> | 2021-06-15 13:25:32 +0300 |
commit | c24ed750cb34ac4056028db72a15d8eb6a0bc7a0 (patch) | |
tree | 18b40b1d50474806b5bb5cb56227449f53af7e56 /controller/editorcontroller.php | |
parent | 15de5fe2c68aa734118fa144371b2b75b0f74060 (diff) |
check can share
Diffstat (limited to 'controller/editorcontroller.php')
-rw-r--r-- | controller/editorcontroller.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/controller/editorcontroller.php b/controller/editorcontroller.php index f71c711..97be564 100644 --- a/controller/editorcontroller.php +++ b/controller/editorcontroller.php @@ -396,10 +396,16 @@ class EditorController extends Controller { "anchor" => $anchor ]); + $canShare = ($file->getPermissions() & Constants::PERMISSION_SHARE) === Constants::PERMISSION_SHARE; + $accessList = $this->shareManager->getAccessList($file); foreach ($recipientIds as $recipientId) { if (!in_array($recipientId, $accessList["users"])) { + if (!$canShare) { + continue; + } + $share = $this->shareManager->newShare(); $share->setNode($file) ->setShareType(IShare::TYPE_USER) |