Skip to content
Snippets Groups Projects
Commit b3125c17 authored by Travis Ralston's avatar Travis Ralston
Browse files

Fix permission check on new usage stats endpoint

parent fe2372d1
No related branches found
No related tags found
No related merge requests found
......@@ -223,7 +223,7 @@ func GetUsersUsageStats(r *http.Request, rctx rcontext.RequestContext, user api.
serverName := params["serverName"]
isGlobalAdmin, isLocalAdmin := api.GetRequestUserAdminStatus(r, rctx, user)
if !isGlobalAdmin || !isLocalAdmin || (isLocalAdmin && r.Host != serverName) {
if !isGlobalAdmin && (serverName != r.Host || !isLocalAdmin) {
return api.AuthFailed()
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment