mirror of
https://github.com/filebrowser/filebrowser.git
synced 2026-07-17 16:36:49 +00:00
fix: cross-user unauthorized share-link deletion
This commit is contained in:
parent
e07c59df0b
commit
0231b7ebdf
5 changed files with 117 additions and 6 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue