mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
user_ldap: Filter groups after nexted groups
Currently groupsMatchFilter is called before nested groups are resolved.
This basicly breaks this feature since it is not possible to inherit
membership in a group from another group.
Minimal example:
Group filter: (&(objectClass=group),(cn=nextcloud))
Nested groups: enabled
cn=nextcloud,ou=Nextcloud,ou=groups,dn=company,dn=local
objectClass: group
cn=IT,ou=groups,dn=company,dn=local
objectClass: group
memberOf: cn=nextcloud,ou=Nextcloud,ou=groups,dn=company,dn=local
cn=John Doe,ou=users,dn=company,dn=local
objectClass: person
memberOf: cn=IT,ou=groups,dn=company,dn=local
Since 'cn=IT,ou=groups,dn=company,dn=local' doesn't match the group
filter, John wouldn't be a member of group 'nextcloud'.
This patch fixes this by filtering the groups after all nested groups
have been collected. If nested groups is disabled the result will be the
same as without this patch.
Signed-off-by: Roland Tapken <roland@bitarbeiter.net>
This commit is contained in:
parent
1aad0100b5
commit
c2d8a36d9a
1 changed files with 1 additions and 2 deletions
|
|
@ -265,7 +265,6 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
|
|||
if (!is_array($groups)) {
|
||||
return array();
|
||||
}
|
||||
$groups = $this->access->groupsMatchFilter($groups);
|
||||
$allGroups = $groups;
|
||||
$nestedGroups = $this->access->connection->ldapNestedGroups;
|
||||
if ((int)$nestedGroups === 1) {
|
||||
|
|
@ -274,7 +273,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
|
|||
$allGroups = array_merge($allGroups, $subGroups);
|
||||
}
|
||||
}
|
||||
return $allGroups;
|
||||
return $this->access->groupsMatchFilter($allGroups);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue