feat: help users with user role assignment [DHIS2-18422] [DHIS2-18446] #1506
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
This PR covers two tickets:
These are conceptually linked because both tickets were created to help users understand and troubleshoot why they were not able to assign user roles from the users app.
Changes
user roles - legacy authorities
You will now see a list of "legacy" authorities (or orphan authorities) when looking at a user role (if applicable).
"Facility Tracker" role on Sierra Leone v42
Antenatal care program (no legacy authorities)
user role edit page - assignability warning
(Note, none of these warnings appear for superusers (e.g.
system
user))-If the role has an authority you do not have, you will see a message explaining that you cannot assign it (by default the list of authorities is collapsed)
-If you set
Allow users to grant own roles
to false in Settings app, you will get a warning about roles that you are assigned to:user role view page - assignability warning
user edit/create page - warnings about unassignable roles
Testing
Automated tests
data
I pass toCustomDataProvider
. It does seem to be called, it's just not resolving for some reason. Anyway, that made me structure the tests slightly different than I would have liked.General code notes