London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
// 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