fix: cross-user unauthorized share-link deletion

This commit is contained in:
Henrique Dias committed 2026-06-03 10:31:44 +02:00
1 parent e07c59df0b
commit 0231b7ebdf
5 files changed
+117 -6

No files matched your search

+3 -3
View File
@@ -15,7 +15,7 @@ type StorageBackend interface {
Gets(path string, id uint) ([]*Link, error)
Save(s *Link) error
Delete(hash string) error
DeleteWithPathPrefix(path string) error
DeleteWithPathPrefix(path string, userID uint) error
}
// Storage is a storage.
@@ -137,6 +137,6 @@ func (s *Storage) Delete(hash string) error {
return s.back.Delete(hash)
}
func (s *Storage) DeleteWithPathPrefix(path string) error {
return s.back.DeleteWithPathPrefix(path)
func (s *Storage) DeleteWithPathPrefix(path string, userID uint) error {
return s.back.DeleteWithPathPrefix(path, userID)
}
+1 -1
View File
@@ -59,7 +59,7 @@ func (f fakeBackend) Delete(_ string) error {
return nil
}
func (f fakeBackend) DeleteWithPathPrefix(_ string) error {
func (f fakeBackend) DeleteWithPathPrefix(_ string, _ uint) error {
return nil
}