Univention Bugzilla – Bug 46130
Filtering for user role shows 0 results if a user has mixed roles
Last modified: 2018-06-04 15:34:08 CEST
Created attachment 9360 [details] patch Patch in branch fbest/46130-graceful-get-all.
Missed to remove customer data in the bug description. I set that one to private. Here is an anonymized version of it: root@ucs01:~# univention-app info UCS: 4.2-3 errata265 App Center compatibility: 4 Installed: self-service=2.0 ucsschool=4.2 v7 Upgradable: Scenario: A Domain Admins opens the module "Users (Schools)", selects a school, selects a role (e.g. Teacher) and searches all those users. Expected behaviour: All users of the selected role show up. Observed behaviour: No results. Zero users are shown. This occurs if at least _one_ user of the selected role has a mixed role status. In the customers case, this was: * "objectClass: ucsschoolStaff" (but not "objectClass: ucsschoolTeacher") * Position in LDAP-directory underneath "cn=lehrer" * Member of the group "cn=lehrer-$SCHOOL" (but not member of "cn=staff-$SCHOOL") management-console-module-schoolwizards.log will also log this error: > 24.01.18 11:57:34.503 MODULE ( PROCESS ) : UDM object uid=mary,cn=lehrer,cn=users,ou=school3,dc=example,dc=org is not Teacher, but actually Staff > 24.01.18 11:57:34.503 MODULE ( ERROR ) : Could not get all objects of 'Teacher': WrongModel("Wrong python class: 'uid=mary,cn=lehrer,cn=users,ou=school3,dc=example,dc=org is not a 'Teacher' but a 'Staff'",) I assume that we cannot prevent the misconfiguration. But I think the search result for ALL users of this role should not be empty, if ONE user is the problem. We might skip such a user, but IMHO we should just show the error message that is logged also in the UMC.
Patch tested and applied. NoObject is the super class for UnknownModel, WrongModel and WrongObjectType and is a subclass of univention.admin.uexceptions.noObject. 4.2 --- [4.2 2aa999c2] Bug #46130: do not prevent listing of all users if one malformed object exists [4.2 7849c1d9] Bug #46130: changelog [4.2 e6d7d97f] Bug #46130: advisory ucs-school-lib (10.0.2-14) 4.3 --- Code committed in branch and not package not built, to not interfere with 4.3 release. [dtroeder/46130_handle_mixed_roles 4711c898] Bug #46130: do not prevent listing of all users if one malformed object exists [dtroeder/46130_handle_mixed_roles 1b82ced4] Bug #46130: changelog
OK What I tested: Reproduced the bug -> The fix works -> OK YAML -> OK Reopen: Could you check in your 4.3 code now or does that need a separate bug?
(In reply to Jürn Brodersen from comment #4) > Reopen: > Could you check in your 4.3 code now or does that need a separate bug? Ah yes - forgot to do that after the 4.3 release. IMHO it's OK to do this here. For bigger changes a new one would be better. [4.3 358467fd] Bug #46130: do not prevent listing of all users if one malformed object exists [4.3 0e800cc6] Bug #46130: changelog [4.3 575bfc12] Bug #46130: advisory ucs-school-lib (11.0.1-6)
OK -> Verified
UCS@school 4.2 v9 has been released. https://docs.software-univention.de/changelog-ucsschool-4.2v9-de.html If this error occurs again, please clone this bug.
UCS@school 4.3 v3 has been released. https://docs.software-univention.de/changelog-ucsschool-4.3v3-de.html If this error occurs again, please clone this bug.