Skip to content

Commit

Permalink
Merge pull request #34 from ConductorOne/anthony/ldap
Browse files Browse the repository at this point in the history
Fixed issue when Grant/Revoke already exisits
  • Loading branch information
notanthony authored Apr 24, 2024
2 parents b8b5e50 + f577814 commit 2701f89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ldap/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (c *Client) getConnection(ctx context.Context, isModify bool, f func(client

// If we are revoking a user's membership from a resource, and the user is not a member of the resource, we don't want to return an error.
// If we are adding a user to a resource, and the user is already a member of the resource, we also don't want to return an error.
if (ldap.IsErrorWithCode(err, ldap.LDAPResultEntryAlreadyExists) || ldap.IsErrorWithCode(err, ldap.LDAPResultUnwillingToPerform)) && isModify {
if ldap.IsErrorAnyOf(err, ldap.LDAPResultAttributeOrValueExists, ldap.LDAPResultEntryAlreadyExists, ldap.LDAPResultUnwillingToPerform) && isModify {
return nil
}
l.Error("baton-ldap: client failed to run function", zap.Error(err))
Expand Down

0 comments on commit 2701f89

Please sign in to comment.