diff --git a/changelog/unreleased/fix-dont-use-hardcoded-groupOfNames-in-group-creation.md b/changelog/unreleased/fix-dont-use-hardcoded-groupOfNames-in-group-creation.md new file mode 100644 index 00000000000..ee5f4b3d448 --- /dev/null +++ b/changelog/unreleased/fix-dont-use-hardcoded-groupOfNames-in-group-creation.md @@ -0,0 +1,6 @@ +Bugfix: Don't use hardcoded groupOfNames in group creation + +When creating a group with different objectClass, it will always use groupOfNames instead of the one provided in the config. +The server now creates groups using the objectClass defined in the config. + +https://github.com/owncloud/ocis/pull/11776 diff --git a/services/graph/pkg/identity/ldap_group.go b/services/graph/pkg/identity/ldap_group.go index ff7d74c3381..3ef5b236169 100644 --- a/services/graph/pkg/identity/ldap_group.go +++ b/services/graph/pkg/identity/ldap_group.go @@ -436,7 +436,7 @@ func (i *LDAP) getGroupCreateLDAPDN(group libregraph.Group) string { func (i *LDAP) groupToLDAPAttrValues(group libregraph.Group) (map[string][]string, error) { attrs := map[string][]string{ i.groupAttributeMap.name: {group.GetDisplayName()}, - "objectClass": {"groupOfNames", "top"}, + "objectClass": {i.groupObjectClass, "top"}, // This is a crutch to allow groups without members for LDAP servers // that apply strict Schema checking. The RFCs define "member/uniqueMember" // as required attribute for groupOfNames/groupOfUniqueNames. So we