Security Model In Salesforce: Data Security- 2

In this article, we will go through the Record Level Security settings provided by Salesforce. Record access can be changed in SFDC using methods below:
  1.  Organization- wide sharing defaults 
  2.  Role Hierarchies
  3.  Sharing Settings
  4.  Manual Sharing
  5.  Apex Sharing 
Organization- wide sharing defaults setting are the most restrictive setting sin Salesforce security model. It can be used to restrict the access to records on object level. Below are the options u can choose n OWD settings:
  1. Private
  2. Public Read Only
  3. Public Read/Write
  4. Public Read/Write/Transfer
  5. Controlled by Parent
Grant access using Hierarchies if it is changed to false for a custom object then the records will not accessible by the role up in the hierarchy. It can only be changed for the custom objects.

 Role Hierarchies define the access in accordance to the organization/company structure or company hierarchy in tree like structure. Users with roles up in the hierarchy have access to the users with role under them. See below the Role hierarchy structure:
Sharing Settings rules helps you share records with users of different roles which are not present above in the role hierarchy or OWD is private for that particular object. There are 2 types of sharing rules :
 1. Criteria- based sharing rules- In this you can share records by setting a criteria on the field values.

 2. Owner- based sharing rules - To share the records on the basis of the owner of the records to other Users.

Manual Sharing is the 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.

Apex Sharing is used when we are unable o use any of the above mechanism to achieve the sharing of records. In this, we use share object which is available for standard objects already like AccountShare and gets created for custom objects when we create them. For custom objects share objects are maned as MyObject__share. We can set the recordId and other things like to whom this record needs to be shared in the share object.

Learn More: JAVA Tutorial : Beginner
                     What is the difference between Workflows and Triggers? (Salesforce)




Comments