-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle sudo connection in the account view #516
Conversation
Expand webadmin.views.my_account to also detect whether the current context was created via sudo If the current session was created with sudo, disable the ability to update experimenter properties and password in the UI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel we need to go a small step further; having an editable form without a "Save" button seems confusing.
Some options, not necessarily better:
- disable (instead of remove) the "Save" button
- add some explanatory text on why there is no "Save" button
- Make the form inactive (e.g. by adding the
inert
property, see https://stackoverflow.com/a/73500364/34171)
Thanks @knabar, the approach of the last commit makes sense to me. Passing back to @will-moore and @pwalczysko for another round of review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
confirming, lgtm |
Fixes #445
Summary of changes
To test this PR, follow the authentication workflow described in #445 (comment) i.e.
--sudo
via the CLIUser settings
Without this PR, the
Save
andChange my password
button should be active. Clicking onSave
should launch the 500 error page with a serverSecurityViolation
of typeCurrent user is not admin for the given user(s)
. Clicking onChange my password
will ask for the current user password which is not known in this workflow since the session was created using the principal password.With this PR, both buttons should be hidden.