LDAP: validate organization role during parsing (#37188)

* LDAP: validate organization role during parsing

* Trigger a new build

* Check if grafana_admin is present
This commit is contained in:
Krzysztof Dąbrowski
2022-05-04 09:35:10 +02:00
committed by GitHub
parent 18f089d1bd
commit c41397a6e7
3 changed files with 24 additions and 34 deletions
+4
View File
@@ -153,6 +153,10 @@ func readConfig(configFile string) (*Config, error) {
}
for _, groupMap := range server.Groups {
if groupMap.OrgRole == "" && groupMap.IsGrafanaAdmin == nil {
return nil, fmt.Errorf("LDAP group mapping: organization role or grafana admin status is required")
}
if groupMap.OrgId == 0 {
groupMap.OrgId = 1
}