graph: Always allow updates to "local" groups when LDAP

When GRAPH_LDAP_SERVER_WRITE_ENABLED=false still allow updates of groups
if a distinct GRAPH_LDAP_GROUP_CREATE_BASE_DN is configured.

Partial-Fix: #6219
This commit is contained in:
Ralf Haferkamp
2023-05-08 16:17:25 +02:00
parent 046895a831
commit 906189462c
2 changed files with 9 additions and 9 deletions
@@ -161,6 +161,10 @@ func TestGetGroup(t *testing.T) {
func TestGetGroupReadOnlyBackend(t *testing.T) {
readOnlyConfig := lconfig
readOnlyConfig.WriteEnabled = false
readOnlyConfig.GroupBaseDN = "ou=groups,dc=test"
readOnlyConfig.GroupCreateBaseDN = "ou=local,ou=group,dc=test"
localGroupEntry := groupEntry
localGroupEntry.DN = "cn=local,ou=local,o=base"
lm := &mocks.Client{}
lm.On("Search", groupLookupSearchRequest).Return(&ldap.SearchResult{Entries: []*ldap.Entry{groupEntry}}, nil)