Describe the 4 Levels of Access Controls Provided by the Salesforce Platform
How a User is Allowed to Access Salesforce?
All questions must result in YES to be approved:
Login Approved

How is a request by a user to view record of a certain object handled at the Profile Level?
Any Question that results in Yes allows object level access, no’s keep going down the line:
If no all the way, no access to record.
The “View All” and “Modify All” object permissions give users access to all of an object’s records, regardless of record-level access settings.

What are the decision steps required to grant access to a record of a certain object?
Any answer of Yes to the following questions results in allowing record access.
No to both 3-1 and 3-2 results in insufficient access. if one is R and the other is U, R will win. (least permissive)

Types of Record Level ‘Access’
Record level access is defined as either record Reading (R in CRUD) or record Editing (U in CRUD)
ie when a public read/only record is shared, the actual grant changes from read to update.
How is a users request (page layout load) to view or edit a certain field handled?
yes to either question here results in granted FLS access, which is then checked against Page layout presence.
Finally is Field present on Page Layout?

What is the definition OWDs and how are they used?
Org Wide Defaults
Definition: Default Sharing patterns and levels, set in the Sharing Settings section of setup. They define the MOST RESTRICTIVE that record level access can be to users who DO NOT OWN the record. Owners have full CRUD (usually)
I.E. If an object is set to Public Read/Only it is impossible to restrict Read Access to a certain record if that user has Read access on the object itself.
Values:
What considerations are there for allowing an object’s record sharing access to be controlled by a parent object?
Specific to only the following objects:
Default access carries through to the default of the parent object (i.e. order controlled by oppty, contact controlled by account, etc.)
What does OWDs control about record access via Role hierarchies?
For Standard Objects, record access is granted through role hierarchies (this cannot be disabled). (i.e. I can see all the Accounts that my direct reports own, when OWD is private or pub R/O)
For Custom Objects: Grant access using hierarchies is selectable.
In order to simplify sharing, Salesforce provides an easy way to share records with managers. To use this sharing rule, an admin must first add the user to a role and grant access.
Role hierarchies only share records UP the hierarchy.
What are the mechanisms via which record sharing access is controlled in Salesforce?
What are the Details of How Salesforce Platform Manages Record Access Grants?
SFDC uses explicit access grants, maintained in a table for each object with CustomObject_sharing or StdObjectShare naming conventions.
if the level of sharing requested during the transaction does not explicitly exist then the access is denied.
Salesforce uses explicit grants when records are shared directly to users or groups. Specifically, Salesforce uses explicit grants when:
Describe Declarative Sharing Rules and Their Types
Role Hierarchies only share records vertically and up the hierarchy, for lateral sharing, we must rely other mechanisms. Two of which are set declaratively:
For example, we can share all the records owned by anyone in a sales executive role with everyone in a service executive role. Similarly, we can share all the records owned by the sales executives, and their subordinates, with others as well.
Every Object gets a set of sharing rules (unless they are controlled by parent)
Manual Sharing
Warning, Currently in Classic only!
Record-level-security provides a mechanism to share individual records with others. This permission is accessed through the Sharing button on the record details page, and lets end-users share individual record with others.
Note: This is only available if the OWD is private or public read-only because otherwise (say public read/write), you wouldn’t need it and there is no sharing table.
Sharing Reason (rowCause) = Manual
Apex Managed Sharing
Apex managed sharing provides developers with the ability to support an application’s particular sharing requirements programmatically through Apex or the SOAP API. This type of sharing is similar to Force.com managed sharing. Only users with “Modify All Data” permission can add or change Apex managed sharing on a record. Apex managed sharing is maintained across record owner changes.
Considerations:
Apex Triggers and User Record Sharing
If a trigger changes the owner of a record, the running user must have read access to the new owner’s user record if the trigger is started through the following:
If a trigger is started through a class that’s not defined with the with sharing keyword, the trigger runs in system mode. In this case, the trigger doesn’t require the running user to have specific access.
Share all the ways implicit sharing grants record access.