Merge pull request #13742 from Cdiscount/feature/fix_ldap_server_admin

fix LDAP Grafana admin logic
This commit is contained in:
Torkel Ödegaard 2018-10-18 14:15:47 +02:00 committed by GitHub
commit 0f592679f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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