Developer forum

Forum » CMS - Standard features » Check if user can impersonate

Check if user can impersonate

Kim Søjborg Pedersen
Reply

Hi, 

I want to check if it is possible for the user to impersonate anyone. I would expect Pageview.User.CanImpersonate() to return false when no options is selected in the "I CAN IMPERSONATE" on the user and on the group containing the user. The user is not in any other groups. But somehow Pageview.User.CanImpersonate() always return true and I can't find documentation in the API doc.

Is this not the correct way to use Pageview.User.CanImpersonate() ?

DW Version 9.15.2

 


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Have you checked if there any parent groups which have impersonations configured?
The ability to impersonate someone is based on the user and all ancestor groups (group parents all the way up in the group tree).
Also, if you are testing this with a currently logged in user then you might need to log off and log in again before the changes have any effect.

/Morten

 

You must be logged in to post in the forum