-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete group memberships when deleting a user #3080
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Approved to soon.
@@ -182,6 +182,20 @@ func (i *LDAP) DeleteUser(ctx context.Context, nameOrID string) error { | |||
if err = i.conn.Del(&dr); err != nil { | |||
return err | |||
} | |||
|
|||
// Find all the groups that this user was a member of and remove it from there | |||
groupEntries, err := i.getLDAPGroupsByFilter(fmt.Sprintf("(%s=%s)", i.groupAttributeMap.member, e.DN), true, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error needs to be checked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Upon deleting a User from the LDAP backend, we also need to cleanup the user's group memberships as LDAP itself doesn't make any promises about referential integrity. Fixes owncloud#3027
f842f05
to
04083a4
Compare
Kudos, SonarCloud Quality Gate passed! |
Description
Upon deleting a User from the LDAP backend, we also need to cleanup
the user's group memberships as LDAP itself doesn't make any promises
about referential integrity.
Related Issue