mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
Do not show create org link when allow_org_create is set to false, Fixes #2135
This commit is contained in:
parent
b39f8fb4de
commit
5962bcbc6c
@ -26,6 +26,7 @@ func Register(r *macaron.Macaron) {
|
||||
// authed views
|
||||
r.Get("/profile/", reqSignedIn, Index)
|
||||
r.Get("/org/", reqSignedIn, Index)
|
||||
r.Get("/org/new", reqSignedIn, Index)
|
||||
r.Get("/datasources/", reqSignedIn, Index)
|
||||
r.Get("/datasources/edit/*", reqSignedIn, Index)
|
||||
r.Get("/org/users/", reqSignedIn, Index)
|
||||
|
@ -99,7 +99,7 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
|
||||
"defaultDatasource": defaultDatasource,
|
||||
"datasources": datasources,
|
||||
"appSubUrl": setting.AppSubUrl,
|
||||
"viewerRoleMode": setting.ViewerRoleMode,
|
||||
"allowOrgCreate": setting.AllowUserOrgCreate || c.IsGrafanaAdmin,
|
||||
"buildInfo": map[string]interface{}{
|
||||
"version": setting.BuildVersion,
|
||||
"commit": setting.BuildCommit,
|
||||
|
@ -79,7 +79,6 @@ var (
|
||||
AllowUserOrgCreate bool
|
||||
AutoAssignOrg bool
|
||||
AutoAssignOrgRole string
|
||||
ViewerRoleMode string
|
||||
|
||||
// Http auth
|
||||
AdminUser string
|
||||
@ -386,7 +385,6 @@ func NewConfigContext(args *CommandLineArgs) {
|
||||
AllowUserOrgCreate = users.Key("allow_org_create").MustBool(true)
|
||||
AutoAssignOrg = users.Key("auto_assign_org").MustBool(true)
|
||||
AutoAssignOrgRole = users.Key("auto_assign_org_role").In("Editor", []string{"Editor", "Admin", "Viewer"})
|
||||
ViewerRoleMode = users.Key("viewer_role_mode").In("default", []string{"default", "strinct"})
|
||||
|
||||
// anonymous access
|
||||
AnonymousEnabled = Cfg.Section("auth.anonymous").Key("enabled").MustBool(false)
|
||||
|
@ -68,11 +68,13 @@ function (angular, _, $, config) {
|
||||
});
|
||||
});
|
||||
|
||||
$scope.orgMenu.push({
|
||||
text: "New Organization",
|
||||
icon: "fa fa-fw fa-plus",
|
||||
href: $scope.getUrl('/org/new')
|
||||
});
|
||||
if (config.allowOrgCreate) {
|
||||
$scope.orgMenu.push({
|
||||
text: "New Organization",
|
||||
icon: "fa fa-fw fa-plus",
|
||||
href: $scope.getUrl('/org/new')
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user