Sub topic 2
What Sharing Rules Do and What They Cannot Do
Assume you know Salesforce objects, profiles, permission sets, and basic SOQL. Sharing rules grant record access beyond org-wide defaults (OWD), which define the baseline access for an object.
Sharing rules: purpose and limits
A sharing rule automatically grants access to records to a group of users. It can target a public group, role, or role and its subordinates. It extends access; it never removes access already granted by ownership, the role hierarchy, permissions, or another sharing mechanism.
Sharing rules also cannot grant object permissions or field-level security. A user still needs permission to read the object, and field-level security can hide individual fields.
Owner-based sharing rules
An owner-based rule selects records according to who owns them. For example, records owned by the Sales role can be shared read-only with the Support public group.
Use this type when ownership represents the access boundary. If ownership changes, Salesforce recalculates the rule and the record may leave the previous sharing set.
Criteria-based sharing rules
A criteria-based rule selects records by field values. For example, invoices with Status__c = Overdue can be shared with the Finance_Managers public group.
Criteria rules are useful when access follows record data rather than ownership. They support defined criteria, not arbitrary per-user decisions. Changes to the fields or target group can trigger sharing recalculation.
<sharingCriteriaRules>
<fullName>Share_Overdue_Invoices</fullName>
<accessLevel>Read</accessLevel>
<label>Share Overdue Invoices</label>
<sharedTo><group>Finance_Managers</group></sharedTo>
<criteriaItems>
<field>Status__c</field>
<operation>equals</operation>
<value>Overdue</value>
</criteriaItems>
</sharingCriteriaRules>Sharing one record manually
Manual sharing grants access to a specific record through the record’s Sharing button. The user must have permission to share the record, such as being its owner or having administrator-level access. Manual shares are useful for exceptions, but they are harder to audit and maintain. They can be removed when ownership changes.
Account teams and team roles
An account team is a set of users working on one account. Each member receives a team role, such as Account Manager or Support Representative, and an access level for the account. Team access can also provide access to related opportunities and cases when configured.
Exercise
Which mechanism should you choose to share every overdue invoice with Finance_Managers?
Show answer
Use a criteria-based sharing rule that targets the Finance_Managers public group.