November Happy Hour will be moved to Thursday December 5th.

Using preview as Visitor Group only and not as Admin

Vote:
 

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?

#89673
Aug 22, 2014 3:23
Vote:
 

What do you use to present the PageDataCollection you receive from your FindPagesWithCriteria?

#89680
Aug 22, 2014 9:11
Vote:
 

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

#89683
Aug 22, 2014 9:24
Vote:
 

Hmm some filtering should be done in FindPageWithCriteria but what happens if you do a FilterForVisitor first?

#89684
Aug 22, 2014 9:26
Vote:
 

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

#89686
Aug 22, 2014 9:32
Vote:
 

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

#89687
Edited, Aug 22, 2014 9:37
Vote:
 

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

#89688
Aug 22, 2014 9:40
* 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.