Use a default non-administrator user Type for new users in model
ClosedPublic

Authored by meven on Dec 14 2019, 8:00 AM.

Details

Summary

If the administrator role was not set for the index assume the default normal user type.

Regression was introduced in D25398.

BUG: 414860
FIXED-IN: 5.18

Test Plan

Created a user as described in https://bugs.kde.org/show_bug.cgi?id=414860

Diff Detail

Repository
R128 User Manager
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 19952
Build 19970: arc lint + arc unit
meven created this revision.Dec 14 2019, 8:00 AM
Restricted Application added a project: Plasma. · View Herald TranscriptDec 14 2019, 8:00 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
meven requested review of this revision.Dec 14 2019, 8:00 AM

Thanks Méven! This fixes the case of creating a non-admin user. However while testing it, I found a regression from D25439: when I create an admin user that has a space in the Real Name field, the "Enable administror privileges for this user" checkbox becomes unchecked and it isn't actually created as an admin user. Do you think you could also fix that in this patch?

meven updated this revision to Diff 71567.Dec 15 2019, 7:45 AM

Set always a default value for role Administrator in m_newUserData

meven updated this revision to Diff 71568.Dec 15 2019, 7:46 AM

Code simplification

meven added a comment.Dec 15 2019, 7:47 AM

Thanks Méven! This fixes the case of creating a non-admin user. However while testing it, I found a regression from D25439: when I create an admin user that has a space in the Real Name field, the "Enable administror privileges for this user" checkbox becomes unchecked and it isn't actually created as an admin user. Do you think you could also fix that in this patch?

This should be fixed now. Thanks for pointing this nasty bug.

ngraham accepted this revision.Dec 15 2019, 10:31 AM

Both issues fixed, no additional regressions found, code looks sane.

This revision is now accepted and ready to land.Dec 15 2019, 10:31 AM
meven updated this revision to Diff 71692.Dec 16 2019, 8:59 PM

Simplify code

This revision was automatically updated to reflect the committed changes.