filestash icon indicating copy to clipboard operation
filestash copied to clipboard

[bug] Cannot un-share a directory/file

Open Finomnis opened this issue 1 year ago • 1 comments

Description of the bug

Version: from docker hub, tag 0f355c1.

When trying to delete a share, I get 403: Access Denied. It's also shown in the log (I replaced the actual ID with <xxx> for privacy's sake):

2023/05/14 10:19:41 HTTP 403 DELETE    1.7ms /api/share/<xxx>

When enabling DEBUG logging, the following line is added:

2023/05/14 10:43:10 SYST DEBUG middleware::session::share 'permission denied - s.CanShare[false] s.Backend[...] GenerateID[...]'

What could be the cause of this? I was able to create and use the share just fine from the same user.

I suspect there is something wrong with the database permissions.

Can you replicate that error from the demo?

Yes.

  • Go to a random file
  • Hit the "share" button
  • Create a share by clicking on the generated link
  • Hit the "share" button again
  • Next to the existing share, click the wastebin icon to delete it
  • Nothing happens, error 403, a notification "permission denied" pops up.

Observed behavior

The observed behavior is that it fails to delete the share, and there doesn't seem to be any other way to delete shares.

Expected behavior

The expected behavior is that the share gets removed and the folder is once again unshared.

Finomnis avatar May 14 '23 10:05 Finomnis

there were a regression indeed which just got fix with the previous commit. Let me know if that fixes it

mickael-kerjean avatar May 24 '23 11:05 mickael-kerjean