Commit 781e66ba by Adrien Fillon

fix LDAP Grafana admin logic

Co-authored-by: Adrien Fillon <adrien.fillon@cdiscount.com>
Co-authored-by: Remi Buisson <remi.buisson@cdiscount.com>
parent 367a2af1
...@@ -185,9 +185,11 @@ func (a *ldapAuther) GetGrafanaUserFor(ctx *m.ReqContext, ldapUser *LdapUserInfo ...@@ -185,9 +185,11 @@ func (a *ldapAuther) GetGrafanaUserFor(ctx *m.ReqContext, ldapUser *LdapUserInfo
if ldapUser.isMemberOf(group.GroupDN) { if ldapUser.isMemberOf(group.GroupDN) {
extUser.OrgRoles[group.OrgId] = group.OrgRole extUser.OrgRoles[group.OrgId] = group.OrgRole
if extUser.IsGrafanaAdmin == nil || *extUser.IsGrafanaAdmin == false {
extUser.IsGrafanaAdmin = group.IsGrafanaAdmin extUser.IsGrafanaAdmin = group.IsGrafanaAdmin
} }
} }
}
// validate that the user has access // validate that the user has access
// if there are no ldap group mappings access is true // if there are no ldap group mappings access is true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment