Display deactivate btn only as admin/account-admin
Description
Added condition to display the deactivate button on user detail page only if current logged in user is admin or account-admin
Look & Feel
Admin
Admin Reader
How to test
- Log in as an admin reader
- visit the user's page
- click on a user
- you should see only one button at the top left of the screen, which should be the reset password button
Further Improvements
None
Related Items
This PR closes: #1185
- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on code under GPL or other license that is incompatible with FlexMeasures
@nhoening should we take this opportunity to also stop displaying the button to reset another user's password if you are an admin-reader?
Yes. Good point.
Also, do you agree we could as a follow-up issue hard-code a list of supported roles? Could also already be done in this PR. We can give them capitalized constants, just like the permission in auth.
This is a preparation for editing users in the UI and giving them roles there, as well.
Also, do you agree we could as a follow-up issue hard-code a list of supported roles? Could also already be done in this PR. We can give them capitalized constants, just like the permission in auth.
This is a preparation for editing users in the UI and giving them roles there, as well.
Let's handle that separately, and we can discuss in a new Issue.