Skip to content

Commit

Permalink
Revert "bugfix: Don't return disabled users on GetUser call"
Browse files Browse the repository at this point in the history
This reverts commit 9b7ec1e.

This needs some more work we need to allow admins to lookup disabled
users.
  • Loading branch information
rhafer committed Dec 21, 2023
1 parent 44ba5ee commit 3a8dbd4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
7 changes: 0 additions & 7 deletions changelog/unreleased/fix-hide-disabled-users.md

This file was deleted.

4 changes: 0 additions & 4 deletions pkg/user/manager/ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ func (m *manager) GetUser(ctx context.Context, uid *userpb.UserId, skipFetchingG
return nil, err
}

if m.c.LDAPIdentity.IsLDAPUserInDisabledGroup(log, m.ldapClient, userEntry) {
return nil, errtypes.NotFound("user is locally disabled")
}

if skipFetchingGroups {
return u, nil
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/utils/ldap/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,12 +503,11 @@ func (i *Identity) getUserFilter(uid string) (string, error) {
escapedUUID = ldap.EscapeFilter(uid)
}

return fmt.Sprintf("(&%s(objectclass=%s)(%s=%s)%s)",
return fmt.Sprintf("(&%s(objectclass=%s)(%s=%s))",
i.User.Filter,
i.User.Objectclass,
i.User.Schema.ID,
escapedUUID,
i.disabledFilter(),
), nil
}

Expand Down

0 comments on commit 3a8dbd4

Please sign in to comment.