Skip to content

Commit

Permalink
fix: adding/removing users to/from groups
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDevMinerTV committed Oct 6, 2023
1 parent 73f51cd commit e3f59e3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions users.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ func (l *LDAP) AddUserToGroup(dn, groupDN string) error {
defer c.Close()

return c.Modify(&ldap.ModifyRequest{
DN: dn,
DN: groupDN,
Changes: []ldap.Change{
{
Operation: ldap.AddAttribute,
Modification: ldap.PartialAttribute{
Type: "memberOf",
Vals: []string{groupDN},
Type: "member",
Vals: []string{dn},
},
},
},
Expand All @@ -168,13 +168,13 @@ func (l *LDAP) RemoveUserFromGroup(dn, groupDN string) error {
defer c.Close()

return c.Modify(&ldap.ModifyRequest{
DN: dn,
DN: groupDN,
Changes: []ldap.Change{
{
Operation: ldap.DeleteAttribute,
Modification: ldap.PartialAttribute{
Type: "memberOf",
Vals: []string{groupDN},
Type: "member",
Vals: []string{dn},
},
},
},
Expand Down

0 comments on commit e3f59e3

Please sign in to comment.