CollaboraOnline / online

Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
https://collaboraonline.com
Other
1.78k stars 681 forks source link

DisableCopy does not remove "Save as" menu option #5167

Closed Raudius closed 2 years ago

Raudius commented 2 years ago

Describe the bug "Save as" menu option is available even when DisableCopy is true.
This is the case when sharing files on Nextcloud with "Allow download" sharing option disabled.

To Reproduce Steps to reproduce the behavior:

  1. In Nextcloud have 2 users
  2. Alice shares file with Bob
  3. Alice disables "Allow download" in the share
  4. Bob opens the shared file
  5. "Save as" option available in the menu

Expected behavior "Save as" option should not be available.

Actual behavior "Save as" option is available.

Nextcloud 25.0.0-beta1 & 24.0.4 Nextcloud office: 6.2.0 COOLWSD: 22.05.4.1

Additional context Sample response for CheckFileInfo operation in the described scenario. (GET /wopi/files/<file_id>)

{
  "BaseFileName": "New document.odt",
  "Size": 7774,
  "Version": "0",
  "UserId": "bob",
  "OwnerId": "alice",
  "UserFriendlyName": "bob",
  "UserExtraInfo": {
    "avatar": "http://nextcloud.local/index.php/avatar/bob/64"
  },
  "UserCanWrite": true,
  "UserCanNotWriteRelative": false,
  "PostMessageOrigin": "http://nextcloud.local/",
  "LastModifiedTime": "2022-08-18T12:20:23.000000Z",
  "SupportsRename": true,
  "UserCanRename": true,
  "EnableInsertRemoteImage": true,
  "EnableShare": true,
  "HideUserList": "",
  "DisablePrint": true,
  "DisableExport": true,
  "DisableCopy": true,
  "HideExportOption": true,
  "HidePrintOption": true,
  "DownloadAsPostMessage": false,
  "SupportsLocks": false
}
Raudius commented 2 years ago

@pedropintosilva Here is the issue I was describing in the community call ;)

Ezinnem commented 2 years ago

Reproducible in: COOLWSD version: 22.05.5.3 git hash: 184488b9

Raudius commented 2 years ago

It was brought to my attention that DisableCopy actually disables copy-pasting in the document, not copying the file.

Disabling UserCanNotWriteRelative prevents writing files to the server. This also removes the "Save as" option :)