owncloud / user_ldap

📒
GNU Affero General Public License v3.0
17 stars 17 forks source link

nested groups work when checkbox nested groups is unchecked #699

Open jnweiger opened 2 years ago

jnweiger commented 2 years ago

Seen with user_ldap 0.16.0 RC2 and owncloud server 10.9.0 RC2

while testing https://github.com/owncloud/user_ldap/pull/683#issuecomment-995381816

Expected behaviour: when disabled, nested groups stop working

jvillafanez commented 2 years ago

I think that it won't work with the "groupScan" algorithm because that was the previous behaviour. For other algorithms, it might work partially without the nested groups checkbox, but there might be issues. Need to investigate.

jvillafanez commented 2 years ago

countUsersInGroup, getUserGroups seem to be the functions that might cause problems returning "wrong" results.

The countUsersInGroups is expected to count the number of users in a group, including nested groups. If G1 contains G2, and G2 contains U1, U2 and U3, then G1 is expected to count 3 users (assuming nested groups is enabled). The getUserGroups is expected to return all the groups the user belongs to. In the above example, U1 should return G1 and G2 (assuming nested groups is enabled)

In those 2 functions, there hasn't been any change, and they'll be affected by the nested groups checkbox. I'm not fully sure where they're used, but for the time being I think it's better to be consistent and follow the restrictions.