diff --git a/conf/defaults.ini b/conf/defaults.ini index 43c13ee7a15..085dfc32059 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -646,6 +646,8 @@ managed_identity_client_id = #################################### Role-based Access Control ########### [rbac] enabled = true +# If enabled, cache permissions in a in memory cache (Enterprise only) +permission_cache = true #################################### SMTP / Emailing ##################### [smtp] diff --git a/conf/sample.ini b/conf/sample.ini index ab2346652b7..f10dc2841a2 100644 --- a/conf/sample.ini +++ b/conf/sample.ini @@ -626,7 +626,8 @@ #################################### Role-based Access Control ########### [rbac] ;enabled = true - +# If enabled, cache permissions in a in memory cache (Enterprise only) +;permission_cache = true #################################### SMTP / Emailing ########################## [smtp] ;enabled = false diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index 663f3cee82c..8e0e532de04 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -445,7 +445,8 @@ type Cfg struct { DashboardPreviews DashboardPreviewsSettings // Access Control - RBACEnabled bool + RBACEnabled bool + RBACPermissionCache bool } type CommandLineArgs struct { @@ -1358,6 +1359,7 @@ func readAuthSettings(iniFile *ini.File, cfg *Cfg) (err error) { func readAccessControlSettings(iniFile *ini.File, cfg *Cfg) { rbac := iniFile.Section("rbac") cfg.RBACEnabled = rbac.Key("enabled").MustBool(true) + cfg.RBACPermissionCache = rbac.Key("permission_cache").MustBool(true) } func readUserSettings(iniFile *ini.File, cfg *Cfg) error {