mirror of
https://github.com/grafana/grafana.git
synced 2024-11-28 11:44:26 -06:00
LDAP: Fix Debug mapping roles and groups (#48059)
Co-authored-by: Jguer <joao.guerreiro@grafana.com> Co-authored-by: Jguer <joao.guerreiro@grafana.com>
This commit is contained in:
parent
412be1f1cf
commit
836f5c1f4a
@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/grafana/grafana/pkg/api/response"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
@ -274,7 +275,7 @@ func (hs *HTTPServer) GetUserFromLDAP(c *models.ReqContext) response.Response {
|
||||
// over another.
|
||||
for _, configGroup := range serverConfig.Groups {
|
||||
for _, userGroup := range user.Groups {
|
||||
if configGroup.GroupDN == userGroup {
|
||||
if strings.EqualFold(configGroup.GroupDN, userGroup) {
|
||||
r := &LDAPRoleDTO{GroupDN: configGroup.GroupDN, OrgId: configGroup.OrgId, OrgRole: configGroup.OrgRole}
|
||||
orgRoles = append(orgRoles, *r)
|
||||
break
|
||||
@ -289,7 +290,7 @@ func (hs *HTTPServer) GetUserFromLDAP(c *models.ReqContext) response.Response {
|
||||
var matched bool
|
||||
|
||||
for _, orgRole := range orgRoles {
|
||||
if orgRole.GroupDN == userGroup { // we already matched it
|
||||
if strings.EqualFold(orgRole.GroupDN, userGroup) { // we already matched it
|
||||
matched = true
|
||||
break
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user