SharingSet
Represents a sharing set. A sharing set defines an access mapping that grants portal or community users access to objects that are associated with their accounts or contacts.
For example, you can grant portal or community users access to all cases related to their account record. Similarly, you can grant portal or community users access to all cases related to a parent account that is identified on the user’s account record.
This type extends Metadata and inherits its fields.
SharingSet components have the suffix .sharingSet and are stored in the sharingSets folder.
Introduced in API version 30.0.
As of Spring ’20 and later, only users with the View Setup and Configuration permission can access this object, and only users with the Manage Sharing permission can edit this object. To create or update sharing sets, you need the Customize Application permission.
Sharing sets are available with these licenses.
- Authenticated Website
- Customer Community Login
- Customer Community Plus
- Partner Community
- Customer Community User
- High Volume Customer Portal
- High Volume Portal
- Overage Authenticated Website User
- Overage High Volume Customer Portal User
- Type: AccessMapping[]
- Required: No
- Description: A list of access mappings on a sharing set.
- Type: string
- Required: No
- Description: The sharing set description. Limit: 255 characters.
- Type: string
- Required: Yes
- Description: Required. The unique identifier for API access. Corresponds to Sharing Set Name on the user interface.
- Type: string[]
- Required: No
- Description: The profiles of users that are granted access to the target objects. Profiles must be associated with a license that can use sharing sets. See Special Access Rules for more information.
AccessMapping
You can grant portal users access to a target object, or to both a target object and its associated objects, such as an account and its contacts and cases.
- Type: string (enumeration of type string)
- Required: Yes
- Description: Required. The target object access level granted to the portal user.
- Possible values:
- Read
- Edit
-
Type: string
-
Required: Yes
-
Description: Required. The target object to which the portal user is gaining access, and refers to one of the following:
AccountCampaignContactCase- Custom Objects (for example,
ObjA__c) OpportunityOrderServiceContractUserWorkOrder
Portal users gain access to all order entitlements and order items under an account to which they have access.
- Type: string
- Required: Yes
- Description: Required. A lookup to the target object, which supports standard or custom fields, or an ID. For accounts or cases associated with entitlements, use
Entitlement.AccountorEntitlement.Case.
-
Type: string (enumeration of type string)
-
Required: Yes
-
Description: Required. The user’s lookup to an account, contact, or a standard or custom field derived from an account or contact. Either the user or the user’s manager can be used in the lookup.
Fieldrefers to a standard or custom field based on an account or contact. -
Possible values:
- Account
- Account. Field
- Contact
- Contact. Field
- Contact.RelatedAccount
- Manager.Account
- Manager.Contact
The following is an example of a SharingSet component that grants users access to all contacts whose ReportsTo fields match the users’ contacts.
The following is an example of a SharingSet component that grants users access to all cases that are related to an entitlement, which is associated with the user’s account.
The following is an example of a SharingSet component with a list of access mappings.
The following is an example package.xml that references the previous definition.
This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.