function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Doug ACFDoug ACF 

Respecting Sharing on Related Lists

It seems that the related lists rendered by <apex:detail> as well as <apex:relatedList> do not respect sharing rules.  Is this expected behavior or am I missing something?

Can you post a snippet of your vf page and controller class? Are you using standard controller? Or extensions/custom controller?


Doug ACFDoug ACF

I'm first trying to sort it out with a super simple page - just a standard controller with no extensions

<apex:page standardController="Account"> <apex:detail/> </apex:page>

So this is really just a mirror of the standard account detail page, except that on the regular page contacts to which the user does not have sharing rights do not show up in the contacts related list.  On this VF page, all of the contacts show up in the related list.

Doug ACFDoug ACF
I retested this and I am now finding that related lists in <apex:detail> and <apex:relatedList> are respecting sharing.