Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
// Will fetch the page even if the user doesn't have priviliges to se the page
// Will throw an Exception if page with ID=3 doesn't exist.
EPiServer.Core.PageData page = EPiServer.Global.EPDataFactory.GetPage(new EPiServer.Core.PageReference(3), EPiServer.Security.AccessControlList.NoAccess);
// Check if page is published
if (page.CheckPublishedStatus(EPiServer.Core.PagePublishedStatus.Published))
{
// Do something
}
// Check if user has access to read the page
if (page.ACL.QueryDistinctAccess(EPiServer.Security.AccessLevel.Read))
{
// Do something
}
I use above functions alot to avoid exceptions in my code.
Regards,
/HAXEN