Try our conversational search powered by Generative AI!

How to check if a not published page is published without being redirected to login page

Vote:
 
Hi all There probably is a fairly simple solution to this problem: Im trying to check if a page is published, but whenever i do GetPage(...) on a page that is not published the users (who lack permissions) is redirected to the login page. To put this is code: PageData objPage = GetPage(objPageReference); if (objPage.CheckPublishedStatus(PagePublishedStatus.Published)){ [...] } I never get past GetPage because the user is redirected, so how am i supposed to be able to do this check? Regards /Fredrik
#12431
Nov 08, 2005 13:46
Vote:
 
You might try GetPage(objPageReference, EPiServer.Security.AccessControlList.NoAccess); which will skip the authorization control. Regards, Johan Olofsson ElektroPost
#14243
Nov 08, 2005 14:38
Vote:
 
Thanks a bunch, that did the trick. objPage = Global.EPDataFactory.GetPage(objPageReference, EPiServer.Security.AccessControlList.NoAccess); /Fredrik
#14244
Nov 08, 2005 16:02
* 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.