Bug 46130 - Filtering for user role shows 0 results if a user has mixed roles
Filtering for user role shows 0 results if a user has mixed roles
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Wizards
UCS@school 4.2
Other other
: P5 normal (vote)
: UCS@school 4.2 v9
Assigned To: Daniel Tröder
Jürn Brodersen
:
Depends on:
Blocks: 46923
  Show dependency treegraph
 
Reported: 2018-01-24 12:38 CET by Michael Grandjean
Modified: 2018-06-04 15:34 CEST (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 4: A User would return the product
User Pain: 0.229
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2018012421000292, 2018043021000524
Bug group (optional):
Max CVSS v3 score:
best: Patch_Available+


Attachments
patch (642 bytes, patch)
2018-01-24 12:43 CET, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Florian Best univentionstaff 2018-01-24 12:43:26 CET
Created attachment 9360 [details]
patch

Patch in branch fbest/46130-graceful-get-all.
Comment 2 Michael Grandjean univentionstaff 2018-01-24 12:49:07 CET
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.
Comment 3 Daniel Tröder univentionstaff 2018-03-13 09:37:26 CET
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
Comment 4 Jürn Brodersen univentionstaff 2018-03-21 10:59:03 CET
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?
Comment 5 Daniel Tröder univentionstaff 2018-03-21 12:12:55 CET
(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)
Comment 6 Jürn Brodersen univentionstaff 2018-03-21 16:01:14 CET
OK -> Verified
Comment 7 Sönke Schwardt-Krummrich univentionstaff 2018-05-02 17:53:05 CEST
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.
Comment 8 Sönke Schwardt-Krummrich univentionstaff 2018-05-02 17:59:26 CEST
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.