mirror of
https://github.com/filebrowser/filebrowser
synced 2026-04-21 13:27:17 +00:00
fix: check download permission in resource handler (#5891)
This commit is contained in:
parent
8adf127c7d
commit
1e03feadb5
1 changed files with 4 additions and 1 deletions
|
|
@ -30,7 +30,7 @@ var resourceGetHandler = withUser(func(w http.ResponseWriter, r *http.Request, d
|
|||
Expand: true,
|
||||
ReadHeader: d.server.TypeDetectionByHeader,
|
||||
Checker: d,
|
||||
Content: true,
|
||||
Content: d.user.Perm.Download,
|
||||
})
|
||||
if err != nil {
|
||||
return errToStatus(err), err
|
||||
|
|
@ -42,6 +42,9 @@ var resourceGetHandler = withUser(func(w http.ResponseWriter, r *http.Request, d
|
|||
file.ApplySort()
|
||||
return renderJSON(w, r, file)
|
||||
} else if encoding == "true" {
|
||||
if !d.user.Perm.Download {
|
||||
return http.StatusAccepted, nil
|
||||
}
|
||||
if file.Type != "text" {
|
||||
return renderJSON(w, r, file)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue