SharingOwnerRule defines an ownership-based record-sharing rule: it shares records owned by one population with another population at a specified access level. Each rule is an entry in the sharingOwnerRules collection of an object's SharingRules component.
This type is an individual rule, not the object-level container. It inherits common settings from SharingBaseRule. Unlike SharingCriteriaRule, it selects records by their owners rather than by record-field filters. It grants access; it does not transfer record ownership.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The individual rule's name within the object's SharingRules representation. This is distinct from the object-qualified member used in a deployment manifest. |
accessLevel |
Required. The access granted to the selected records. Interpret it together with sharedFrom and sharedTo. |
sharedFrom |
Required. Selects the owners whose records are shared. Uses the SharedTo structure despite having a source-selection role. |
sharedTo |
Required. Selects the recipients who receive access to the records. |
accountSettings |
For Account rules, separately controls access to related cases, contacts, and opportunities. Each settings entry requires all three related-record access fields below. |
caseAccessLevel |
Under accountSettings, controls access to cases associated with the Account. Allowed values: None, Read, Edit. |
contactAccessLevel |
Under accountSettings, controls access to contacts associated with the Account. Allowed values: None, Read, Edit. |
opportunityAccessLevel |
Under accountSettings, controls access to opportunities associated with the Account. Allowed values: None, Read, Edit. |
label |
Required. The rule's label. |
description |
Describes the rule. Maximum length is 1,000 characters. |
Behavior and Constraints
Owner selection and recipient selection are different
sharedFrom, sharedTo, and accessLevel are all required. Changing sharedFrom changes which owners' records qualify. Changing sharedTo changes who receives access. Although both population fields use SharedTo, reversing them reverses the meaning of the rule.
For example, a rule with sharedFrom.role set to COO, sharedTo.role set to CEO, and accessLevel set to Edit grants the recipient role edit access to records owned by the source role. It does not assign those records to the recipient.
criteriaItems and booleanFilter belong to SharingCriteriaRule, not SharingOwnerRule. Use the criteria-based type when selection depends on record-field values.
Population selectors depend on org configuration
The selectors inside sharedFrom and sharedTo identify organizational populations. The same selector identifies owners under sharedFrom and recipients under sharedTo.
-
Groups:
groupidentifies groups. Broad group selectors includeallCustomerPortalUsers,allInternalUsers, andallPartnerUsers. The internal-users selector includes internal and nonportal users. -
Channel-program groups:
channelProgramGroupandchannelProgramGroupsidentify system-managed groups containing partner members of the corresponding channel programs or levels. -
Roles:
roleselects the listed roles.roleAndSubordinatesInternalexpands through roles below the selected roles.roleAndSubordinatescan also include portal accounts below those roles when portal accounts are enabled. -
Portal roles:
portalRoleselects users in a portal role. The portal-role subordinate selector includes users under that role as well; its casing differs across representations, as described below. -
Queues:
queueapplies only to Lead, Case, and custom-object sharing rules. -
Territories:
territoryselects territories.territoryAndSubordinatesalso includes territories below each selected territory.
roleAndSubordinates is available only when digital experiences is enabled and Experience Cloud site users have external account roles other than a shared person account role. Do not treat it as interchangeable with roleAndSubordinatesInternal.
With Sales Territories, both sharedFrom and sharedTo must use modelName.territoryName for territory and territoryAndSubordinates. Here, modelName is the active territory model's API name, and territoryName is the territory's API name.
Actual affected users and records depend on current group memberships and role or territory assignments. The rule definition does not enumerate every affected user or record.
Related-record access and administrative permissions
For Account rules, review accountSettings alongside accessLevel. Looking only at the Account grant can miss access granted to associated cases, contacts, or opportunities.
SharedTo is reused by other features, so not every field exposed by that structure is valid here. In particular, guestUser is restricted to SharingGuestRule.
Viewing sharing-rule configuration requires View Setup and Configuration. Editing it requires Manage Sharing. These administrative permissions are separate from the record access granted by the rule.
Deployment and Retrieval
The enclosing SharingRules component is stored in the sharingRules directory, with an object-named file such as Account.sharingRules or ObjA__c.sharingRules. Ownership-based, criteria-based, territory-based, and guest-user rules are separate child collections within that object-level representation.
An owner rule's name appears in its own fullName element. Manifest selection adds the object scope. The SharingRules documentation includes a package.xml example with SharingOwnerRule as the type and ObjA__c.* as the member. The asterisk selects the object's owner-rule collection in that example; it does not turn SharingOwnerRule into the object-level container.
SharingRules supports wildcard manifest selection, and its documentation describes organization-wide retrieval, deployment, and deletion of sharing rules. However, the same documentation conflicts about operations scoped by rule type. The object-qualified owner-rule example must be read with that limitation in mind, especially when planning deletion. Manual sharing is outside these metadata operations.
SharingBaseRule supplies inherited settings but cannot be created directly. Use the concrete rule categories within SharingRules, not a standalone base-rule component. Additional manifest examples are available under sharing-rule manifest samples.
Relationships
SharingRules contains this type through sharingOwnerRules. SharingOwnerRule inherits settings from SharingBaseRule and uses the SharedTo helper for both source and recipient populations. SharingTerritoryRule extends SharingOwnerRule, but remains a separate child category in the container.
The reference elements below can occur within either sharedFrom or sharedTo. Their position determines whether they select owners or recipients.
References
-
Group:allCustomerPortalUsers,allInternalUsers,allPartnerUsers,channelProgramGroup,channelProgramGroups,group. -
Role:portalRole,portalRoleandSubordinates,role,roleAndSubordinates,roleAndSubordinatesInternal. -
Queue:queue. -
TerritoryModel:territory,territoryAndSubordinates.
Referenced By
-
SharingRules:sharingOwnerRules.
Documentation Inconsistencies
The deployment scope is ambiguous. The official SharingRules documentation says that sharing rules cannot be retrieved, deleted, or deployed by rule type. Its manifest example nevertheless selects SharingOwnerRule using the object-qualified member ObjA__c.*. The example demonstrates that selector, but does not resolve the broader conflict about supported type-scoped operations.
The portal subordinate selector also has a casing discrepancy: the exposed element schema uses portalRoleAndSubordinates, while Salesforce's SharedTo definition names it portalRoleandSubordinates. The difference matters when interpreting or serializing that selector.
Reported Issues
-
Manifest naming and rule category can change deployment diagnosis. In a 2016 discussion about a criteria-based rule rejected with "Component type not permissible in destination Organization", an answer recommended an object-qualified member such as
ObjectAPIName.SharingRuleNameunder the matching rule type. Its example also includedSharingOwnerRule. This was a suggested manifest correction for a criteria-rule failure, not a confirmed owner-rule-specific defect. Read the deployment discussion. -
Manual recreation was reported as unnecessary for moving ownership-based rules between orgs. A 2017 accepted answer reported that change sets include ownership-based and criteria-based sharing rules for standard and custom objects. It also showed
ObjA__c.*underSharingOwnerRulefor a manifest-based migration. Read the migration discussion. - A retrieve-only operation was recommended to check which owner rules a manifest selects. In a 2017 discussion about prefix-style wildcard members, answers recommended retrieving and inspecting the resulting object-level sharing-rules XML before deployment. The discussion did not establish that partial-name wildcards select every intended match. Read the retrieval-validation discussion.
Common Questions
What is the difference between sharedFrom and sharedTo in SharingOwnerRule?
sharedFrom selects the owners whose records are shared. sharedTo selects the recipients of access. Both use SharedTo, but neither transfers ownership.
How do I retrieve ownership-based sharing rules for one object?
The official manifest example uses SharingOwnerRule with an object-qualified member such as ObjA__c.*. Retrieved rules use the enclosing object-level SharingRules representation. The documentation also contradicts itself about type-scoped operations, so that example does not settle every retrieval or deletion scope.
Can I deploy ownership-based sharing rules with a change set?
A 2017 community report describes ownership-based sharing rules for both standard and custom objects as available in change sets. The same report shows manifest-based migration as another approach.
Why does an Account owner-sharing rule affect contacts, cases, or opportunities?
accountSettings controls access to those related records separately from the Account's accessLevel. Its caseAccessLevel, contactAccessLevel, and opportunityAccessLevel fields each accept None, Read, or Edit.
Are roleAndSubordinates and roleAndSubordinatesInternal interchangeable?
No. roleAndSubordinates can include portal accounts below the selected roles and has digital-experience and external-role prerequisites. roleAndSubordinatesInternal is a distinct selector for the subordinate-role population.