rookie0 / nextcloud-sharing-path

🌩 Nextcloud app to enhance files sharing to be accessed by stored path, can be used as CDN origin.
GNU Affero General Public License v3.0
47 stars 11 forks source link

Default setting is not respected #33

Closed sushibear closed 3 years ago

sushibear commented 3 years ago

I discovered that even if the administrator gobal setting for sharing path is checked, and the users personal sharing settings are reading "Enable sharing path Set by admin" and their checkbox is checked, the default setting is not respected and getting a file from a users shared path, results in a 403.

With other words, the default setting has currently no effect.

Following this procedure you can test this yourself:

  1. Login as administrator and go to settings > administration/sharing > turn on Default Enable sharing path
  2. Create a new user
  3. Login as new user and setup a shared directory, upload a file to this directory you want to share
  4. Right click the file inside the share directory, copy sharing path and try it inside a new tab
  5. Result is a 403
  6. Go back to the users personal share settings and uncheck the sharing path checkbox and then check it again
  7. Now try to access the file again and voila.. it works as expected :/
sushibear commented 3 years ago

Any help with this?

sushibear commented 3 years ago

Looks like this is not returning any value IF the user did not uncheck and check sharing path in his settings. https://github.com/rookie0/nextcloud-sharing-path/blob/8d0c5994ef7c8d5e04ecce834f1bdcfb0592a71e/lib/Controller/PathController.php#L83

rookie0 commented 3 years ago

Sorry for the late reply, i will take a look later and welcome submit a PR.

sushibear commented 3 years ago

Sorry for the late reply, i will take a look later and welcome submit a PR.

I would but I am currently not sure what triggers this problem. Would be great if you could take a look as well. :)

sushibear commented 3 years ago

Did you have a chance to look into this? I am sure some issues are releated to this one.

rookie0 commented 3 years ago

@sushibear So sorry for this late fix, please take a look v0.4.1 - nightly