nextcloud / officeonline

officeonline
43 stars 15 forks source link

Files can't be opened in groupfolder without sharing option #567

Open Dennis1993 opened 2 months ago

Dennis1993 commented 2 months ago

Describe the bug Users can't open files if the file is located in a groupfolder without the share persmission. If a users has only READ and WRITE permission and no SHARE the following error appears:

image

As an admin account I can open this file without any problems. If I set the SHARE permission for users the problem is gone: image

To Reproduce Steps to reproduce the behavior:

  1. Create a groupfolder
  2. Grant no share permission for a users
  3. open a file

Expected behavior File should be opens if the users has no share permission. Read-permission is enough

Client details:

Server details

Operating system: Ubuntu 20.04.4

Web server: Apache 2.5.59

Database: MariaDB

PHP version: 8.3

Nextcloud version: 29.0.2

Version of the officeonline app 2.2.1

Version of Office Online server latest

{"reqId":"UVSHHiKiNnoaI2oezkHq","level":3,"time":"2024-06-19T17:02:19+00:00","remoteAddr":"10.10.2.12","user":"--","app":"index","method":"GET","url":"/index.php/apps/officeonline/wopi/files/2882441_oc9f2e8f0a5d/contents?access_token=m7f6RnVQ0DIEQm0FLNYf9rTRHYBJ3CmB&access_token_ttl=0","message":"Call to a member function fopen() on null in file '/var/www/html/apps/officeonline/lib/Controller/WopiController.php' line 326","userAgent":"MSWAC","version":"29.0.2.2","exception":{"Exception":"Exception","Message":"Call to a member function fopen() on null in file '/var/www/html/apps/officeonline/lib/Controller/WopiController.php' line 326","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","Line":170,"Previous":{"Exception":"Error","Message":"Call to a member function fopen() on null","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"getFile","class":"OCA\\Officeonline\\Controller\\WopiController","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/apps/officeonline/lib/Controller/WopiController.php","Line":326},"message":"Call to a member function fopen() on null in file '/var/www/html/apps/officeonline/lib/Controller/WopiController.php' line 326","exception":[],"CustomMessage":"Call to a member function fopen() on null in file '/var/www/html/apps/officeonline/lib/Controller/WopiController.php' line 326"},"id":"6673121300388"} {"reqId":"4X0GXDJsIDuZMPd2qi4g","level":3,"time":"2024-06-19T17:12:09+00:00","remoteAddr":"10.10.2.12","user":"--","app":"PHP","method":"GET","url":"/index.php/apps/officeonline/wopi/files/2882441_oc9f2e8f0a5d/contents?access_token=6sTBUrmgRsp1AVvp4mpIWWcvlZgbOVUC&access_token_ttl=0","message":"Undefined array key 0 at /var/www/html/apps/officeonline/lib/Controller/WopiController.php#313","userAgent":"MSWAC","version":"29.0.2.2","data":{"app":"PHP"},"id":"66731170e024e"} #### Nextcloud log (data/nextcloud.log) ``` Insert your Nextcloud log here ``` #### Browser log ``` ![image](https://github.com/nextcloud/officeonline/assets/1473674/98d45dae-79b2-455b-8602-2e40998d6350) ```