fix: show item shares from all users to admins (#5941)

This commit is contained in:
mehmet turac authored and GitHub committed 2026-05-17 15:01:02 +02:00
1 parent e38c28273a
commit 9cc18a81e3
3 files changed
+111 -1

No files matched your search

+9 -1
View File
@@ -57,7 +57,15 @@ var shareListHandler = withPermShare(func(w http.ResponseWriter, r *http.Request
})
var shareGetsHandler = withPermShare(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) {
s, err := d.store.Share.Gets(r.URL.Path, d.user.ID)
var (
s []*share.Link
err error
)
if d.user.Perm.Admin {
s, err = d.store.Share.GetsByPath(r.URL.Path)
} else {
s, err = d.store.Share.Gets(r.URL.Path, d.user.ID)
}
if errors.Is(err, fberrors.ErrNotExist) {
return renderJSON(w, r, []*share.Link{})
}