Limit access to Jukebox for admins only (configurable).

Closes #2849
This commit is contained in:
Deluan
2024-05-07 19:35:43 -04:00
parent 86567f5406
commit dd4374cec6
3 changed files with 17 additions and 4 deletions
+3 -1
View File
@@ -40,7 +40,9 @@ func (api *Router) GetUsers(r *http.Request) (*responses.Subsonic, error) {
user.ScrobblingEnabled = true
user.DownloadRole = conf.Server.EnableDownloads
user.ShareRole = conf.Server.EnableSharing
user.JukeboxRole = conf.Server.Jukebox.Enabled
if conf.Server.Jukebox.Enabled {
user.JukeboxRole = !conf.Server.Jukebox.AdminOnly || loggedUser.IsAdmin
}
response := newResponse()
response.Users = &responses.Users{User: []responses.User{user}}
return response, nil