Impersonate Users feature of MWS

Hi All,

Has anyone ever used the “Impersonate Users” feature of MWS? Where can I read more about that? What are the capabilities of this feature and how to implement this?

This is for MWS 9.5

Thanks and Regards,
Ninad Patil

Hi Ninad,

I’ve a piece of code for it but no information why we use it. I got it from some where and it might help you.

IContext context context = ContextFactory.acquireContext(true);
IDirUser user = (IDirUser) dirSystemPolicy.lookupPrincipalByID(context, userID, IDirSystem.TYPE_USER);
IThingID userThingID = user.getDirectoryPrincipalID();
boolean currentUser = context.isAdminSession();
context.impersonate(userThingID, currentIsAdmin );