Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Checking page access

Vote:
 

How to check page access even if I am logged in as a user who doesn't have access?  Is there a way by which for checking page access alone, I can pass some admin  user id?

 

 

#21730
Jul 07, 2008 14:19
Vote:
 

Hi

If you have a PageData called "page" and a user as an IPrincipal called "user" you can do the following:

bool hasAccess = page.ACL.QueryDistinctAccess(user, AccessLevel.Read);

Regards

Per Gunsarfs

#21735
Jul 07, 2008 16:38
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.