0.2.63 update
This commit is contained in:
@@ -61,6 +61,10 @@ func (s *Server) adminRoutes() http.Handler {
|
||||
mux.Handle("POST /admin/api/request-policy", s.adminAuth(s.handleAdminRequestPolicy))
|
||||
mux.Handle("GET /admin/api/sonarr-request-policy", s.adminAuth(s.handleAdminSonarrRequestPolicy))
|
||||
mux.Handle("POST /admin/api/sonarr-request-policy", s.adminAuth(s.handleAdminSonarrRequestPolicy))
|
||||
mux.Handle("GET /admin/api/radarr-request-policy", s.adminAuth(s.handleAdminRadarrRequestPolicy))
|
||||
mux.Handle("POST /admin/api/radarr-request-policy", s.adminAuth(s.handleAdminRadarrRequestPolicy))
|
||||
mux.Handle("GET /admin/api/arr-integrations", s.adminAuth(s.handleAdminArrIntegrations))
|
||||
mux.Handle("POST /admin/api/arr-integrations", s.adminAuth(s.handleAdminArrIntegrations))
|
||||
mux.Handle("POST /admin/api/playback-policy", s.adminAuth(s.handleAdminPlaybackPolicy))
|
||||
mux.Handle("GET /admin/api/hero/search", s.adminAuth(s.handleAdminHeroSearch))
|
||||
mux.Handle("POST /admin/api/hero-policy", s.adminAuth(s.handleAdminHeroPolicy))
|
||||
@@ -459,8 +463,10 @@ func (s *Server) handleAdminRequestPolicy(w http.ResponseWriter, r *http.Request
|
||||
return
|
||||
}
|
||||
valid := make(map[string]bool, len(known))
|
||||
usernames := make(map[string]string, len(known))
|
||||
for _, user := range known {
|
||||
valid[user.ID] = true
|
||||
usernames[user.ID] = user.Username
|
||||
}
|
||||
seen := map[string]bool{}
|
||||
allowed := make([]string, 0, len(req.AllowedUserIDs))
|
||||
@@ -482,7 +488,15 @@ func (s *Server) handleAdminRequestPolicy(w http.ResponseWriter, r *http.Request
|
||||
writeError(w, http.StatusInternalServerError, "could not save request access")
|
||||
return
|
||||
}
|
||||
s.loggerFor(r.Context()).Info("media request access changed", "users", len(allowed))
|
||||
allowedNames := make([]string, 0, len(allowed))
|
||||
for _, id := range allowed {
|
||||
allowedNames = append(allowedNames, usernames[id])
|
||||
}
|
||||
s.loggerFor(r.Context()).Info("Media Request access level updated",
|
||||
"gateway_version", buildinfo.Version(),
|
||||
"allowed_usernames", strings.Join(allowedNames, ", "),
|
||||
"allowed_user_ids", strings.Join(allowed, ", "),
|
||||
"allowed_users", len(allowed))
|
||||
writeJSON(w, http.StatusOK, policy)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user