Developer forum

Forum » Ecommerce - Standard features » Assortments + Impersonation

Assortments + Impersonation

Nuno Aguiar
Reply

Hi,

 

We have a project where the client wants impersonation, but we need it with Assortments. How can I get this to work?

 

Right now it renders the primary login's assortments, not the secondary. We are using the new index engine (don't know if it's relevant).

 

Best Regards,

Nuno Aguiar


Replies

 
Nicolai Høeg Pedersen
Reply

Hm, I don't think that is possible because of the way impersonation is made...

When you impersonate, we basically have 2 users logged in. But you do not actually take over the entire login - the impersonater is still the user logged in.

I think it might be possible by 'cheating' the impersonation feature and turn it around so that the users actually switch.

You want to take over the entire login of the user that is being impersonated, and when logging off (de-impersonate) fall back to the user that you were originally logged in as?

BR Nicolai

 
Nuno Aguiar
Reply

Hi Nicolai,

 

Yeah, that would do the trick. In fact I feel that's what most customer consider how the impersonation should work (given their comments). Can you suggest the best way to approach the issue?

 

Here's what I though so far

  • Keep the impersonation backend features to get a list of users the logged in user can impersonate
  • Overriding (somehow) the secondary login method to save the primary login user on session variable, log him out and log in the "new one"
  • Overriding the logout method to check if there's was a primary login user and log him in

 

I see the issue with getting an accurate audit trail for both the impersonater and the impersonatee, but hopefully the client can live without it, unless you find a better way to do it.

 

The main thing is getting impersonation to work, as per the projects request "navigate and see the website as my client would".

 

Looking forward for your comments,

Nuno Aguiar

 
Martin Grønbekk Moen
Martin Grønbekk Moen
Reply

We also need this functionality in a new project.
Did you solve this in any way Nuno?

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Martin,

 

It was solved with "Full Impersonation" https://doc.dynamicweb.com/documentation-9/platform/advanced-settings/control-panel#6464

 

Essentially the account you impersonate becomes the "primary" and the initial user you logged in with becomes the secondary. That essentially triggers all of DW's features to work associated with the impersonated user (there might be some exceptions to watch out for, but it works really well for the most part - we've been using it like this for the US projects for about 4 years now).

 

Let me know if you have any questions.

 

Best Regards,

Nuno Aguiar

 

You must be logged in to post in the forum