Skip to content

Commit

Permalink
fix: Block incompatible operations with remote tokens
Browse files Browse the repository at this point in the history
With federated tokens we do not allow storage operations that would be
relative to the file path so we should block them

Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Apr 30, 2024
1 parent 75bfff6 commit ca84d61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Controller/WopiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ public function checkFileInfo($fileId, $access_token) {
'UserFriendlyName' => $userDisplayName,
'UserExtraInfo' => [],
'UserCanWrite' => (bool)$wopi->getCanwrite(),
'UserCanNotWriteRelative' => $this->encryptionManager->isEnabled() || $isPublic || $wopi->getHideDownload(),
'UserCanNotWriteRelative' => $this->encryptionManager->isEnabled() || $isPublic || $wopi->getHideDownload() || $wopi->isRemoteToken(),
'PostMessageOrigin' => $wopi->getServerHost(),
'LastModifiedTime' => Helper::toISO8601($file->getMTime()),
'SupportsRename' => !$isVersion,
'UserCanRename' => !$isPublic && !$isVersion,
'SupportsRename' => !$isVersion && !$wopi->isRemoteToken(),
'UserCanRename' => !$isPublic && !$isVersion && !$wopi->isRemoteToken(),
'EnableInsertRemoteImage' => !$isPublic,
'EnableShare' => $file->isShareable() && !$isVersion && !$isPublic,
'HideUserList' => '',
Expand Down

0 comments on commit ca84d61

Please sign in to comment.