Skip to content
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

FEATURE: Implement user impersonation #3648

Merged
merged 5 commits into from Mar 24, 2022
Merged

Conversation

markusguenther
Copy link
Member

@markusguenther markusguenther commented Mar 21, 2022

Extending the Neos with endpoints to impersonate a logged-in user and also restoring the user.
For that, the change will add a new controller ImpersonateController for the backend.

Backend Administrators will get the permission to impersonate users, and everybody is able to restore the origin user if the user is authenticated by the impersonation. The change extends the user management module with a button for each user and the user menu in the to bar to be able to restore the user.

The user menu in the content module needs to be adjusted in the neos-ui.

Screen.Recording.2022-03-21.at.15.56.27.mp4

Resolves: #3647

@markusguenther
Copy link
Member Author

Will reference another PR in the neos-ui to add the restore button also there.

Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is the code from Unikka.LoginAs, give or take a little? I love that already!

For this, can we please have strict typing, typed arguments and all that jazz? This is going into master, after all. 😎

Neos.Neos/Resources/Private/Translations/en/Main.xlf Outdated Show resolved Hide resolved
Neos.Neos/Classes/Security/ImpersonateAspect.php Outdated Show resolved Hide resolved
markusguenther and others added 4 commits March 23, 2022 19:55
Extending the neos with endpoints to impersonate a logged in user and also restoring the user.
For that the change will add a new controller ImpersonateController for the backend.

Backend Administrators will get the permission to impersonate users and everbody is able to restore the origin user if the user is authenticated by the impersonation. The change extends the user management module with a button for each user and the user menu in the to bar to be able to restore the user.

The user menu in the content module needs to be adjusted in the neos-ui.
Co-authored-by: Karsten Dambekalns <karsten@dambekalns.de>
Prevent exceptions when the session is not started yet.
Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works beautifully! ❤️ Just the change for the Neos.UI is missing…

@markusguenther
Copy link
Member Author

Sorry, will provide the UI change today 🙈

@kdambekalns kdambekalns merged commit ed81472 into master Mar 24, 2022
@kdambekalns kdambekalns deleted the feature/impersonation branch March 24, 2022 07:15
markusguenther added a commit to markusguenther/neos-ui that referenced this pull request Mar 24, 2022
With Neos 8.0 we introduce the impersonation feature. So, it is possible to impersonate as a different user from the user management module.

This change will add related endpoints to the neos-ui to be able to communicate with the Neos.Neos API. The impersonation state will be saved in the Redux store, and a saga handles the restore of the origin user.

Besides the data handling stuff, we also add a new button to the user menu.

Related Neos PR:
neos/neos-development-collection#3648
@markusguenther
Copy link
Member Author

Finally, the PR for the UI. Sorry it took a bit longer, but it was not just copy and paste. The Unikka.LoginAs package makes some parts bit different and does not use the real APIs and the Store.

But with that changes, it is easier to detect the state from other packages and areas in the UI as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FEATURE: Add impersonation of users to the neos backend
4 participants