Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Correct behaviour of DataFactory.GetChildren(PageReference)

Hi all, According to the SDK, the DataFactory.GetChildren(PageReference) method should return 'Children of pageLink that the user has at least Read access to.' However, it actually returns all child pages, even unpublished pages and pages that the user don't have read access to. What is the correct behaviour of this method? Returning all child pages or returning those that the current user can read (SDK should be updated if this is the case)? Thanks, Christoffer
Feb 20, 2008 17:57
GetChildren() will NOT filter result on access * EPiServer lists will filter for you * Use FilerAccess or FilterForVisitor to filter when binding to asp lists. PageDataCollection pages = GetChildren(PageReference.StartPage); EPiServer.Filters.FilterAccess access = new EPiServer.Filters.FilterAccess(); access.Filter(pages); repeater.DataSource = pages; repeater.DataBind();
Feb 20, 2008 19:13
Thank you for the report Christoffer. The SDK does not seem to have been updated for the new behaviour and I have added a bug report for this.
Feb 21, 2008 8:59
Thank you for the clarification! FilterForVisitor seems like a convenient way to do this. Thanks, Christoffer
Feb 21, 2008 10:53
It returns all pages, by you can use the FilterForVisitor filter to get only the pages that are visible to "Everyone" users.
Feb 03, 2009 16:25
"It returns all pages, by you can use the FilterForVisitor filter to get only the pages that are visible to "Everyone" users."
I don't think that's accurate, it checks if the user has read access. Everyone role or not has nothing to do with it. I hope.
Feb 17, 2011 17:52
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.