Newer Version Available

This content describes an older version of this product. View Latest

Try It Out: Define Sharing Rules

Since we just defined our Reviewers public group, let's use it to define our sharing rule for review records.

  1. From Setup, enter Sharing Settings in the Quick Find box, then select Sharing Settings.

Remember this page? We were last here when we defined our org-wide defaults.

  1. In the Manage sharing settings for drop-down list, choose Job Application.

Choosing an object in this drop-down list allows us to focus in on the org-wide defaults and sharing rules for a single object at a time rather than looking at all of them in a long page—a really useful thing if you've got a large organization with several custom objects.

If you had chosen Review instead of Job Application, you wouldn’t have the option of creating sharing rules, since you can’t create sharing rules for a detail record in a master-detail relationship. However, since you chose Job Application, a Sharing Rules related list appears. We'll use that to create the sharing rules that will apply to both the Job Application and the Review objects.

  1. In the Job Application Sharing Rules area, click New.
  2. In the Label text box, enter Review Records.
  3. Click the Rule Name text box to populate it automatically.
  4. For the rule type, make sure Based on record owner is selected.
  5. In the Job Application: owned by members of drop-down list, select Public Groups.
  6. Next to that drop-down list, choose All Internal Users.

Just as we talked about already, you can define a sharing rule only for a single public group, role, or role with all of its subordinates. By default, the platform includes a default public group that encompasses every user in your organization.

  1. In the Share with drop-down list, select Public Groups.
  2. Next to that drop-down list choose Reviewers.
  3. In the Access Level drop-down list, select Read/Write.
  4. Click Save.
  5. Click OK in the dialog box that says this operation could take significant time.

And that's it! We just created a rule that shares reviews written and owned by any member of the organization with all recruiters and hiring managers. Since reviewers and hiring managers all need the power to read and update reviews, we handled everyone with a single sharing rule and a public group.

To finish up, create the following owner-based sharing rules:
Table 1. Additional Sharing Rules
Object Rule Label Owned by... Should be shared with... Access Level
Candidate Edit Candidates All Internal Users The role and subordinates of the Recruiting Manager Read/Write
Employment Website Edit Employment Websites The role and subordinates of the Recruiting Manager Reviewers Read/Write
Position Edit Positions The role and subordinates of the Recruiting Manager The role and subordinates of the Recruiting Manager Read/Write
The sharing rule for the Employment Website object is necessary to let hiring managers post jobs, even though they will never update employment website records directly (the org-wide defaults prevent that). Without the rule, hiring managers can see employment website records but can’t create job postings. This is because the Job Posting object is a junction object (as you may recall from the last chapter), and the Employment Website object is one of the Job Posting object's two master-detail relationships. Sharing access to a junction object record is determined by a user's sharing access to both associated master records (in this case, the associated position and employment website records) and the Sharing Setting option on the relationship field. For example, if the sharing setting on both parents is Read/Write, then the user must have Read/Write access to both parents in order to have Read/Write access to the junction object.

In the sharing rule for the Employment Website object, we opted to use the existing Reviewers public group. Doing this saved us a few clicks without granting access to any users who shouldn't be looking at employment website records.

Beyond the Basics

Did you know you can use criteria-based sharing rules to open up record access to users?

Say you want to share records based on field values in records instead of record owners. You can set up sharing rules based on field value criteria and apply filter logic to open up specific record access to users.

To find out more, see “Criteria-Based Sharing Rules��� in the Salesforce Help.