h
h copied to clipboard
Enable users to change their own role on the `/groups/{pubid}/edit/members` page
See also: https://github.com/hypothesis/h/issues/9135
Currently users can't use the Members table on the /groups/{pubid}/edit/members to change their own role: there is a row in the table for the user's own membership, but the role in this table row isn't editable.
Make the role in the user's own table row editable so that users can use the table to edit their own role.
Notes:
- This should be a frontend-only change: the backend API for editing roles already allows a user to edit their own role.
- Downgrading your own role has consequences for what you can and can't do in the group and (unlike when changing someone else's role) cannot be undone: once you've downgraded yourself you can't upgrade yourself back to your old role. No user can upgrade their own role. Before we allow a user to downgrade their own role we need to show a warning dialog to this effect, importantly including the fact that this can't be undone.
- Changing your own role changes what actions you can take against every other member in the group, so after changing the user's own role the frontend will have to call the get-group-members API to re-fetch all displayed members and update their rows in the table.
- This interacts with pagination (https://github.com/hypothesis/h/issues/9133): if the table is paginated and the UI is currently displaying page
n, we may want to maintain that state and stay on pageneven after re-fetching all the members.- This would similarly interact with any other state that the page has, such as: sort ordering (https://github.com/hypothesis/h/issues/9144), search filtering (https://github.com/hypothesis/h/issues/9143), etc. (None of these features have been implemented yet at the time of writing.)