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
lkplkp 

Sharing Rules

Hi,

I need to know if Apex Sharing overrides Sharing Rules/Organization Wide Defaults/Role Hierarchy?  My orginization has Apex Sharing that we are trying to remove all together but there are still some triggers/class that are active.  We have set up Sharing Rules/Organization Wide Defaults/Role Hierarchy and it is working for all objects (standard and custom) except 2 objects.  It's like the system is not recognizing the private on Organization Wide Defaults for the 2 new objects.  If anyone can help, that would be great.
 

Thanks!

GSBassoGSBasso
I wouldn't say overrides as much as augments.

For example, if the Organization Wide Default is private but you manually create a __share record for, say, a group, then members of that group would have visibility to that record.

It's basically the same effect as clicking on the Sharing button on the record and manually assigning shares that way. These act over and above, and in some cases contrary, to whatever org wide defaults and sharing rules you've setup.

Hope this helps.