fix(create org): Anonymous user can no longer create org, Fixes #2227

This commit is contained in:
Torkel Ödegaard
2015-06-25 17:06:43 +02:00
parent 7806da11e6
commit 24bab47f14
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
"defaultDatasource": defaultDatasource,
"datasources": datasources,
"appSubUrl": setting.AppSubUrl,
"allowOrgCreate": setting.AllowUserOrgCreate || c.IsGrafanaAdmin,
"allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin,
"buildInfo": map[string]interface{}{
"version": setting.BuildVersion,
"commit": setting.BuildCommit,
+1 -1
View File
@@ -40,7 +40,7 @@ func getOrgHelper(orgId int64) Response {
// POST /api/orgs
func CreateOrg(c *middleware.Context, cmd m.CreateOrgCommand) Response {
if !setting.AllowUserOrgCreate && !c.IsGrafanaAdmin {
if !c.IsSignedIn || (!setting.AllowUserOrgCreate && !c.IsGrafanaAdmin) {
return ApiError(401, "Access denied", nil)
}