User roles Switching

I wanted to create a "view as" function. I've seen this in a system but I have no idea how to implement it. Has anyone implemented something like this?

I'll give you an example:
In a system, there is an administrator user and editor users (they have limitations in their roles). However, in certain situations, to meet a specific need, the administrator user could, after logging into the system, click on a button and access the system as "editor A" (even without knowing the editor's password). He would be seeing and acting as "editor A".

I don't know if that was clear.
It's something similar to this wp plugin in this link.
User Switching – Plugin do WordPress | WordPress.org Brasil

Any guidance on this would be greatly appreciated.

Please check:

1 Like

Perfect,

I tried to research the subject, I believe I didn't use the correct terms, I would have hardly come across this post without your help.

Thank you