Salesforce: Sharing Cheat Sheet

Sharing is complex, but necessarily so. It gives you incredibly fine-grained control over data access through it’s flexibility but requires quite a deep understanding to do it properly. There are great articles out there that describe sharing in detail e.g. Force.com object and record level security An Overview of Force.com Security I don’t want to recreate what’s in those articles, instead I’m providing a short, sharp cheat sheet of the major topics you need to understand. So without further ado… Sharing Cheat Sheet Sharing Metadata Records Implicit Sharing Organisation-Wide Defaults (OWD) No Relationship Master Detail Lookup Manual Sharing Apex Managed Sharing Recalculation Choosing the Right Share Type “Traditional” / Ownership-based Sharing Rules Criteria-based Sharing Rules Apex Managed Sharing Rules Manual Sharing Rules Share Groups Sharing Sets Portals High Volume Portals (Service Cloud Portals) other portals Large Data Volumes If you’ve got any other items you think should be in this …

Read more

‘With Sharing’ Keyword

Recently I came across a rather confusing situation with my Force.com application. I had whittled down my profiles; implemented a marvelous role hierarchy; and a number of sharing rules, and although my application was functionally restricted i.e. object-level access, field-level access etc., the data didn’t seem to be restricted by the sharing model i.e. I could see data created by user A when logged in as user B, even though I had explicitly disabled this behaviour.

The application I’m developing may not be the same or even similar to yours, especially since I don’t use any standard pages. I suspect that if I had use more of the standard functionality I may have guessed at the solution a bit earlier.

Read more