diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-07-27 17:45:14 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-10-13 15:35:56 +0300 |
commit | 820dc521bf46c7a144c949c5bf6a27e00b9b48a4 (patch) | |
tree | dc2952c7b6314aed2c40216bec70921f5376dfe6 /lib | |
parent | 00e02c06def5b5e8fa1cbb1e2fd1b6567971e985 (diff) |
Do not offer share option and rename in version view
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/WopiController.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Controller/WopiController.php b/lib/Controller/WopiController.php index ddb758c2..fd5046c0 100644 --- a/lib/Controller/WopiController.php +++ b/lib/Controller/WopiController.php @@ -161,6 +161,7 @@ class WopiController extends Controller { $guestUserId = 'Guest-' . \OC::$server->getSecureRandom()->generate(8); $user = $this->userManager->get($wopi->getEditorUid()); $userDisplayName = $user !== null && !$isPublic ? $user->getDisplayName() : $wopi->getGuestDisplayname(); + $isVersion = $version !== '0'; $response = [ 'BaseFileName' => $file->getName(), 'Size' => $file->getSize(), @@ -174,10 +175,10 @@ class WopiController extends Controller { 'UserCanNotWriteRelative' => \OC::$server->getEncryptionManager()->isEnabled() || $isPublic, 'PostMessageOrigin' => $wopi->getServerHost(), 'LastModifiedTime' => Helper::toISO8601($file->getMTime()), - 'SupportsRename' => true, - 'UserCanRename' => !$isPublic, + 'SupportsRename' => !$isVersion, + 'UserCanRename' => !$isPublic && !$isVersion, 'EnableInsertRemoteImage' => true, - 'EnableShare' => true, + 'EnableShare' => $file->isShareable() && !$isVersion, 'HideUserList' => 'desktop', 'DisablePrint' => $wopi->getHideDownload(), 'DisableExport' => $wopi->getHideDownload(), |