Skip to content

Commit

Permalink
incorporate requested changes
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Richter <crichter@owncloud.com>
  • Loading branch information
dragonchaser committed Jun 9, 2022
1 parent e9ad130 commit c4f7a36
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions extensions/graph/pkg/identity/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ import (
"github.com/gofrs/uuid"
ldapdn "github.com/libregraph/idm/pkg/ldapdn"
libregraph "github.com/owncloud/libre-graph-api-go"

"golang.org/x/exp/slices"

"github.com/owncloud/ocis/v2/extensions/graph/pkg/config"
"github.com/owncloud/ocis/v2/extensions/graph/pkg/service/v0/errorcode"
"github.com/owncloud/ocis/v2/ocis-pkg/log"
"golang.org/x/exp/slices"
)

var (
Expand Down Expand Up @@ -361,14 +359,11 @@ func (i *LDAP) GetUser(ctx context.Context, nameOrID string, queryParam url.Valu
if err != nil {
return nil, err
}
userGroups, err := i.getGroupsForUser(e.DN)
if err != nil {
return nil, err
}
sel := strings.Split(queryParam.Get("$select"), ",")
exp := strings.Split(queryParam.Get("$expand"), ",")
u := i.createUserModelFromLDAP(e)
if slices.Contains(sel, "memberOf") || slices.Contains(exp, "memberOf") {
userGroups, err := i.getGroupsForUser(e.DN)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit c4f7a36

Please sign in to comment.