improve ModGroup to perform NOP
This commit is contained in:
parent
ca0832a010
commit
0689ee46fd
17
app/ldap.go
17
app/ldap.go
@ -278,7 +278,22 @@ func (l LDAPClient) AddGroup(gid string, group Group) (int, gin.H) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l LDAPClient) ModGroup(gid string, group Group) (int, gin.H) {
|
func (l LDAPClient) ModGroup(gid string, group Group) (int, gin.H) {
|
||||||
return 200, gin.H{
|
modifyRequest := ldap.NewModifyRequest(
|
||||||
|
fmt.Sprintf("cn=%s,%s", gid, l.groupsdn),
|
||||||
|
nil,
|
||||||
|
)
|
||||||
|
|
||||||
|
modifyRequest.Replace("cn", []string{gid})
|
||||||
|
|
||||||
|
err := l.client.Modify(modifyRequest)
|
||||||
|
if err != nil {
|
||||||
|
return http.StatusBadRequest, gin.H{
|
||||||
|
"ok": false,
|
||||||
|
"error": err,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return http.StatusOK, gin.H{
|
||||||
"ok": true,
|
"ok": true,
|
||||||
"error": nil,
|
"error": nil,
|
||||||
}
|
}
|
||||||
|
1
go.mod
1
go.mod
@ -31,7 +31,6 @@ require (
|
|||||||
github.com/gorilla/sessions v1.4.0 // indirect
|
github.com/gorilla/sessions v1.4.0 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
|
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
|
||||||
github.com/knz/go-libedit v1.10.1 // indirect
|
|
||||||
github.com/leodido/go-urn v1.4.0 // indirect
|
github.com/leodido/go-urn v1.4.0 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
|
Loading…
Reference in New Issue
Block a user