mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-19 15:23:36 +00:00
feat(api): restrict access to library and config endpoints to admin users
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
1 parent
403fe19e1a
commit
7dce0da557
5 files changed
+172
-104
No files matched your search
@@ -9,7 +9,6 @@ import (
|
||||
"github.com/navidrome/navidrome/core"
|
||||
"github.com/navidrome/navidrome/log"
|
||||
"github.com/navidrome/navidrome/model"
|
||||
"github.com/navidrome/navidrome/model/request"
|
||||
"github.com/navidrome/navidrome/utils/req"
|
||||
)
|
||||
|
||||
@@ -30,11 +29,6 @@ func inspect(ds model.DataStore) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
|
||||
user, _ := request.UserFrom(ctx)
|
||||
if !user.IsAdmin {
|
||||
http.Error(w, "Inspect is only available to admin users", http.StatusUnauthorized)
|
||||
}
|
||||
|
||||
p := req.Params(r)
|
||||
id, err := p.String("id")
|
||||
|
||||
|
||||
Reference in new issue
Block a user