Hello, I've created a page that pulls in its child pages and displays their content in an accordion. I need to restrict some of the child pages by visitor groups (by setting the Visible to on the page and selecting which visitor groups) so that only relevant data is shown on the parent page.
When I try to preview the parent page from different visitor groups, I see child pages I shouldn't be able to view (I am using FindPagesWithCriteria to get a subset of the child pages, and then FilterForVisitor to cut out any the user doesn't have access to), because I am in EPiServer and I have admin access to all pages
If I log out and view the page on the site, then those child pages don't appear on the parent page as expected. But I am not able to test different visitor groups.
Is there any way of using the Preview as a visitor group function in EPiServer, as just that visitor group, without admin access? Or to filter the pages by visitor group only and ignore users and groups?
What do you use to present the PageDataCollection you receive from your FindPagesWithCriteria?
I'm casting it to an IEnumerable of the page type, then looping through each page and doing a RenderPartial to show each page in an accordion style
Hmm some filtering should be done in FindPageWithCriteria but what happens if you do a FilterForVisitor first?
I believe it is filtering correctly as the page is not displayed when I am not logged into EPiServer and I am viewing the page as a normal user. The only thing is that I cannot preview the page as different visitor groups from within EPiServer because even though I have restricted the page to visitor groups, because I'm logged in, I still have permission to view the page, even though I'm not in the allowed visitor group
I guess you're using the preview function for visitor groups and it still doesn't work?
See preview on http://s29.postimg.org/mlkf7kv7r/Preview.gif
Yes that's what I'm trying to use. I believe I can still see everything because FilterForVisitor is checking the user has access to it, and since I'm logged in to EPiServer, I have access to all the pages, so previewing as a visitor group isn't working in this case