mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Handle request service account when not enabled (#42122)
* Handle request service account when not enabled
This commit is contained in:
parent
fe84454bb0
commit
a145ec37bb
@ -96,6 +96,10 @@ func (hs *HTTPServer) AddAPIKey(c *models.ReqContext, cmd models.AddApiKeyComman
|
||||
return response.Error(403, "Target service is not in the same organisation as requesting user or api key", err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if cmd.CreateNewServiceAccount {
|
||||
return response.Error(400, "Service accounts disabled. Retry create api request without service account flag.", err)
|
||||
}
|
||||
}
|
||||
|
||||
newKeyInfo, err := apikeygen.New(cmd.OrgId, cmd.Name)
|
||||
|
Loading…
Reference in New Issue
Block a user