nextcloud / richdocuments

📑 Collabora Online for Nextcloud
https://nextcloud.com/collaboraonline
357 stars 117 forks source link

Guest users are unable to save documents #4229

Open elzody opened 1 week ago

elzody commented 1 week ago

Describe the bug When the guests app is enabled, a guest user is unable to edit and save an office document which has been shared to them. This is due to the default quota for guests being set to 0.

To Reproduce

  1. Download and enable the guests app
  2. Give guest users permission to use the richdocuments app
  3. Create a guest user OC_PASS=somepassword php occ guests:add --password-from-env --display-name "guest user" <created-by> guest@example.com
  4. Create an office document (in my case a spreadsheet) and share it to the newly created guest user
  5. Open a new browser window and login as the guest user (the username is the email set for the user)
  6. Access the document shared to the guest user and make a few edits
  7. Try to save the document and see the error popups

Expected behavior The expected behavior is that the share owner's quota is used rather than the guest user's quota. It makes sense for the guest quota to default to 0 for blocking file uploading, but for document editing it makes more sense to handle it differently. If you're sharing a document to a guest with editing permissions, you want them to be able to actually edit and save the document.

⚠️ Reproducible from master to stable28

Logs #### Nextcloud log (data/nextcloud.log) ``` { "reqId": "ZDlS4hWmEp9X24wRvBjJ", "level": 3, "time": "2024-11-14T15:45:59+00:00", "remoteAddr": "172.20.0.1", "user": "--", "app": "richdocuments", "method": "POST", "url": "/index.php/apps/richdocuments/wopi/files/56_ocnnlnfpgb7y/contents?access_token=yUV9MvHSRPUTFhOpnONRNUHMVsi1dlUF&access_token_ttl=0", "message": "Not enough storage", "userAgent": "COOLWSD HTTP Agent 24.04.9.2", "version": "28.0.11.1", "exception": { "Exception": "Exception", "Message": "Not enough storage", "Code": 0, "Trace": [ { "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line": 230, "function": "putFile", "class": "OCA\\Richdocuments\\Controller\\WopiController", "type": "->", "args": [ "56", "yUV9MvHSRPUTFhOpnONRNUHMVsi1dlUF" ] }, { "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line": 137, "function": "executeController", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->", "args": [ [ "OCA\\Richdocuments\\Controller\\WopiController" ], "putFile" ] }, { "file": "/var/www/html/lib/private/AppFramework/App.php", "line": 184, "function": "dispatch", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->", "args": [ [ "OCA\\Richdocuments\\Controller\\WopiController" ], "putFile" ] }, { "file": "/var/www/html/lib/private/Route/Router.php", "line": 315, "function": "main", "class": "OC\\AppFramework\\App", "type": "::", "args": [ "OCA\\Richdocuments\\Controller\\WopiController", "putFile", [ "OC\\AppFramework\\DependencyInjection\\DIContainer" ], [ "56_ocnnlnfpgb7y", "richdocuments.wopi.putFile" ] ] }, { "file": "/var/www/html/lib/base.php", "line": 1069, "function": "match", "class": "OC\\Route\\Router", "type": "->", "args": [ "/apps/richdocuments/wopi/files/56_ocnnlnfpgb7y/contents" ] }, { "file": "/var/www/html/index.php", "line": 39, "function": "handleRequest", "class": "OC", "type": "::", "args": [] } ], "File": "/var/www/html/apps-extra/richdocuments/lib/Controller/WopiController.php", "Line": 525, "message": "Not enough storage", "exception": {}, "CustomMessage": "Not enough storage" } } ```