Posted on 08/07/2014 09:59:41
Hi Morten
That is Dynamicweb.Security.IsCurrentUserAllowed(frontend.page) that takes care of that check. But it is not public.
Using the Notifications.Standard.Page.OnOutput notification, you can check if Pageview.Current.GlobalTags contains a tag called Global:Page.IsProtected - it is "True" if the page is protected - string.empty if it is not protected. If the user logs in and has access it will be empty also.
I've made Dynamicweb.Security.IsCurrentUserAllowed(frontend.page) public for 8.5
You can use Pageview.Current.User.Groups and check against the list found in Pageview.Current.Page.Value("Pagepermission") - the latter a CSV list. If it is found, the user has access.
Nicolai