Resolve "Impersonate a user as admin"
This merge request introduces the ability for an admin to impersonate a user. Because the admin user management functionality is a premium feature, this can only be used if a user has access to the premium version. Most of the impersonation logic is handled by the web-frontend.
The impersonation deliberately requires a page refresh. This is because on first page load certain items like groups, application, etc are fetched. Because we don't want to refresh everything, it seemed like a good idea to do the impersonation on page load before this happens.
Testing pointers
- The backend impersonate endpoint can only be used if the requesting user has access to the premium version.
- The backend impersonate endpoint can only be used if the requesting user is staff or super user.
- As much code as possible lives in the
premium
folder. - Clicking on the three dots on the admin user management page shows an option to impersonate.
- The JWT token of the admin should never be overwritten.
- Refreshing the page should stop the impersonation.
- While impersonating an orange notification in the top left corner should indicate that you're impersonating someone.
- Clicking on the stop button in the top left corner should stop the impersonation.
- Real time collaboration should work while impersonating.
- A new endpoint must be introduced to the API docs.
Merge Request Checklist
-
changelog.md has been updated if required -
New/updated Premium features are separated correctly in the premium folder -
The latest Chrome and Firefox have been used to test any new frontend features -
Documentation has been updated -
Quality Standards are met -
Performance: tables are still fast with 100k+ rows, 100+ field tables -
The redoc API pages have been updated for any REST API changes -
Our custom API docs are updated for changes to endpoints accessed via api tokens -
The UI/UX has been updated following UI Style Guide
Closes #830 (closed)
Edited by Bram Wiepjes