Try our conversational search powered by Generative AI!

Correct behaviour of DataFactory.GetChildren(PageReference)

Vote:
 
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
#16003
Feb 20, 2008 17:57
Vote:
 
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();
#16787
Feb 20, 2008 19:13
Vote:
 
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.
#16788
Feb 21, 2008 8:59
Vote:
 
Thank you for the clarification! FilterForVisitor seems like a convenient way to do this. Thanks, Christoffer
#16789
Feb 21, 2008 10:53
Vote:
 
It returns all pages, by you can use the FilterForVisitor filter to get only the pages that are visible to "Everyone" users.
#27590
Feb 03, 2009 16:25
Vote:
 
"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.
#48846
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.