keycloak-ui
keycloak-ui copied to clipboard
Allow user and admin attribute permissions to be independantly set
Motivation
When using the experimental feature declarative user profile it was not possible to allow only the admin to view/edit an attribute. When admin was selected, user was always included.
Brief Description
Changed update handling of attribute permission checkboxes.
Verification Steps
- Enable declarative user profile feature
- Set "User Profile Enabled" to "on"
- Go "User Profile" and edit any attribute
- Select "admin" (user should no longer be selected automatically)
Checklist:
- [X] Code has been tested locally by PR requester
- [NA] User-visible strings are using the react-i18next framework (useTranslation)
- [NA] Help has been implemented
- [NA] axe report has been run and resulting a11y issues have been resolved
- [NA] Unit tests have been created/updated
@jonkoops Is there anything I can help with?
This functionality is made this way to make it clear when you select admin the user is always included. Just not setting the checkbox doesn't change that behaviour.
Right @xianli123 ?
@edewit Yes, if the "Admin" is marked, the "User" should be selected and read-only.
The reason why we have suggested this, is to have the possibilty of attributes which are only viewable / editable by the admin - and NOT the user.
So if by design the user always should be selected, is there another way to achieve the desired behaviour?
As far as we have tested our patch, the application correctly handles this (i.e. field is only visible/editable to user when the permissions are set correctly (we have tested the account management api, i.e. https://...url.../realms/master/account)
@xianli123 @edewit I believe that @micbis is correct here.
@xianli123 did you have some notes or something that say enabling Admin
should always enable User
?
Hi @ssilvert I have checked the design doc and the original issue, there is no evidence to proven the "Admin" can effect the "User". I think @micbis is correct.
A linkage relationship here is that if the User or Admin has the ability to Edit, the User or admin will have the right to View by default.
I tested this out and it looks good.
@micbis Can you rebase your branch please?
@ssilvert Sure, done.
The test failures in the suite are expected, I'm going ahead and merge this in.