AccessControl: Add enterprise only setting for rbac permission cache (#49006)

* Add enterprise only setting for RBAC permission cache

Co-authored-by: Jguer <joao.guerreiro@grafana.com>
This commit is contained in:
Karl Persson 2022-05-16 17:52:10 +02:00 committed by GitHub
parent e2e9616c87
commit 2dc45e3e72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -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]

View File

@ -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

View File

@ -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 {