---
schema_version: "1"
id: a9fb30d7f8eb9a31ebf8d3e36cce4e4c5eb666f22fb6fac55b4532b297c93fcd
title: SharingRules
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_sharingrules.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_sharingrules.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: c28c962242ca5b7873a92a3dfc45796197ecf346fdb2ef3555e2c0402a8372ca
description: Represents the base container for sharing rules, which can be criteria-based, ownership-based, territory-based, or for guest user access. SharingRules enables you to share records with a set of users, using rules that specify the access level for the target user group.
---
# SharingRules

Represents the base container for sharing rules, which can be criteria-based, ownership-based, territory-based, or for guest user access. SharingRules enables you to share records with a set of users, using rules that specify the access level for the target user group.

This type extends the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm "The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.") metadata type and inherits its fullName field. For more information, see “Sharing Rules” in Salesforce Help.

In API version 33.0 and later, retrieving, deleting, or deploying of all sharing rules in an organization is available. Wildcard support is also available. You can’t retrieve, delete, or deploy manual sharing rules or sharing rules by their type (owner, criteria-based, territory, or guest user).

## Declarative Metadata File Suffix and Directory Location

In API version 33.0 and later, components are stored in the sharingRules folder and their file name matches the object name with the suffix .sharingRules. Criteria-based, owner-based, territory-based, and guest user sharing rules are all contained in a object.sharingRule file.

Before API version 33.0, SharingRules components are stored in their corresponding object directory and the file name matches the object name. For example, the accountSharingRules directory contains an Account.sharingRules file for account sharing rules. SharingRules for custom objects are stored in the customObjectSharingRules directory, which contains files with the .sharingRules extension such as ObjA\_\_c.sharingRules, where ObjA refers to the developer name of a custom object type.

## Version

SharingRules components are available in API version 24.0 and later, but these components are no longer available in API version 33.0 and later: AccountSharingRules, CampaignSharingRules, CaseSharingRules, ContactSharingRules, LeadSharingRules, OpportunitySharingRules, AccountTerritorySharingRules, CustomObjectSharingRules, UserSharingRules.

In API version 33.0 and later, use [SharingCriteriaRule](#SharingCriteriaRule), [SharingOwnerRule](#SharingOwnerRule) and [SharingTerritoryRule](#SharingTerritoryRule).

## Special Access Rules

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.

## Fields

The following information assumes that you’re familiar with implementing sharing rules for standard objects and custom objects. For more information on these fields, see “Sharing Settings” in Salesforce Help.

| Field | Field Type | Description |
| --- | --- | --- |
| sharingCriteriaRules | [SharingCriteriaRule](#SharingCriteriaRule)\[\] | An array of criteria-based sharing rules. Available in API version 33.0 and later. |
| sharingGuestRules | [SharingGuestRule](#SharingGuestRule)\[\] | An array of guest user sharing rules. Available in API version 47.0 and later. |
| sharingOwnerRules | [SharingOwnerRule](#SharingOwnerRule)\[\] | An array of ownership-based sharing rules. Available in API version 33.0 and later. |
| sharingTerritoryRules | [SharingTerritoryRule](#SharingTerritoryRule)\[\] | An array of territory-based sharing rules. Available in API version 33.0 and later. |

## SharingCriteriaRule

Defines a criteria-based sharing rule. It extends [SharingBaseRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_sharingbaserule.htm "Represents sharing rule settings such as access level and to whom access is granted.") and inherits all its fields. Available in API version 33.0 and later.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d864512e258">Field</th>

              <th class="featureTableHeader  " id="d864512e261">Field Type</th>

              <th class="featureTableHeader  " id="d864512e264">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d864512e258" data-title="Field"><span class="keyword parmname">booleanFilter</span></td>

              <td class="entry" headers="d864512e261" data-title="Field Type">string</td>

              <td class="entry" headers="d864512e264" data-title="Description">Advanced filter conditions that are specified for the sharing
                rule.</td>

            </tr>

            <tr>
              <td class="entry" headers="d864512e258" data-title="Field"><span class="keyword parmname">criteriaItems</span></td>

              <td class="entry" headers="d864512e261" data-title="Field Type">
                <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customfield.htm#filteritem">FilterItem</a>[]
              </td>

              <td class="entry" headers="d864512e264" data-title="Description">An array of the boolean criteria (conditions) for the sharing
                rule.</td>

            </tr>

            <tr>
              <td class="entry" headers="d864512e258" data-title="Field"><span class="keyword parmname">includeRecordsOwnedByAll</span></td>

              <td class="entry" headers="d864512e261" data-title="Field Type">boolean</td>

              <td class="entry" headers="d864512e264" data-title="Description">Required. Indicates whether records owned by users who can’t have
                an assigned role are included in the records shared (<samp class="codeph nolang">true</samp>) or not (<samp class="codeph nolang">false</samp>). Examples of users who can’t
                have an assigned role are high-volume users and system users such as
                automated process users.or Salesforce system users.
                <p class="p">You can’t edit this field after the sharing rule is created.</p>
              </td>

            </tr>

          </tbody>

        </table>

## SharingGuestRule

Defines a guest user sharing rule. It extends [SharingBaseRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_sharingbaserule.htm "Represents sharing rule settings such as access level and to whom access is granted.") and inherits all its fields, except accountSettings. Available in API version 47.0 and later.

![Note](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note.png)

#### Note

For SharingGuestRule, the accessLevel field can be set only to Read.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d864512e367">Field</th>

              <th class="featureTableHeader  " id="d864512e370">Field Type</th>

              <th class="featureTableHeader  " id="d864512e373">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d864512e367" data-title="Field"><span class="keyword parmname">booleanFilter</span></td>

              <td class="entry" headers="d864512e370" data-title="Field Type">string</td>

              <td class="entry" headers="d864512e373" data-title="Description">Advanced filter conditions that are specified for the sharing
                rule. Available in API version 48.0 and later.</td>

            </tr>

            <tr>
              <td class="entry" headers="d864512e367" data-title="Field"><span class="keyword parmname">criteriaItems</span></td>

              <td class="entry" headers="d864512e370" data-title="Field Type">
                <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/customfield.htm#filteritem">FilterItem</a>[]
              </td>

              <td class="entry" headers="d864512e373" data-title="Description">An array of the boolean criteria (conditions) for the sharing
                rule. Available in API version 48.0 and later.</td>

            </tr>

            <tr>
              <td class="entry" headers="d864512e367" data-title="Field"><span class="keyword parmname">includeHVUOwnedRecords</span></td>

              <td class="entry" headers="d864512e370" data-title="Field Type">boolean</td>

              <td class="entry" headers="d864512e373" data-title="Description">Required. Indicates whether records owned by high-volume
                community or site users are included in the records shared (<samp class="codeph nolang">true</samp>) or not (<samp class="codeph nolang">false</samp>). By default, only records
                owned by authenticated users, guest users, and queues are included
                in sharing rules. This field has a default value of <samp class="codeph nolang">false</samp>. Available in API version
                52.0 and later.
                <p class="p">You can’t edit this field
                  after the sharing rule is created.</p>
              </td>

            </tr>

          </tbody>

        </table>

## SharingOwnerRule

Defines an ownership-based sharing rule. It extends [SharingBaseRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_sharingbaserule.htm "Represents sharing rule settings such as access level and to whom access is granted.") and inherits all its fields. Available in API version 33.0 and later.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d864512e467">Field</th>

              <th class="featureTableHeader  " id="d864512e470">Field Type</th>

              <th class="featureTableHeader  " id="d864512e473">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d864512e467" data-title="Field"><span class="keyword parmname">sharedFrom</span></td>

              <td class="entry" headers="d864512e470" data-title="Field Type"><a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_sharedto.htm" title="SharedTo defines the sharing access for a list view or a folder. It can be used to specify the target and source for owner-based sharing rules.">SharedTo</a></td>

              <td class="entry" headers="d864512e473" data-title="Description">Required. Specifies the record owners. <p class="p">If you’re using Sales
                  Territories, use <var class="keyword varname">modelName.territoryName</var> for
                  the shared-to and shared-from <span class="keyword parmname">territory</span> and
                  <span class="keyword parmname" id="field_territoryAndSubordinates"><a name="field_territoryAndSubordinates"><!-- --></a>territoryAndSubordinates</span> values on the SharedTo
                  type, where:
                </p>

                <ul class="ul bulletList">
                  <li class="li">
                    <var class="keyword varname">modelName</var> equals the name of the active
                    territory model in the API.
                  </li>

                  <li class="li">
                    <var class="keyword varname">territoryName</var> equals the territory’s name
                    in the API.
                  </li>

                </ul>

              </td>

            </tr>

          </tbody>

        </table>

## SharingTerritoryRule

Defines a territory-based sharing rule. It extends [SharingOwnerRule](#SharingOwnerRule) and inherits all its fields. Available in API version 33.0 and later.

## AccountSharingRules

Represents the sharing rules for accounts. It extends the SharingRules metadata type and inherits its fullName field. Only available in API version 32.0 and earlier.

| Field | Field Type | Description |
| --- | --- | --- |
| criteriaBasedRules | [AccountCriteriaBasedSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_cbsrule.htm#AccountCriteriaBasedSharingRule-BA7CB418)\[\] | List that defines user criteria-based rules. |
| ownerRules | [AccountOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_ownersharingrule.htm#AccountOwnerSharingRule)\[\] | List that defines user membership-based rules. |

## CampaignSharingRules

Represents the sharing rules for campaigns. It extends the SharingRules metadata type and inherits its fullName field. Only available in API version 32.0 and earlier.

| Field | Field Type | Description |
| --- | --- | --- |
| criteriaBasedRules | [CampaignCriteriaBasedSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_cbsrule.htm#CampaignCriteriaBasedRule-BA7DF3F4)\[\] | List that defines user criteria-based rules. |
| ownerRules | [CampaignOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_ownersharingrule.htm#CampaignOwnerSharingRule)\[\] | List that defines user membership-based rules. |

## CaseSharingRules

Represents the sharing rules for cases. It extends the SharingRules metadata type and inherits its fullName field. Only available in API version 32.0 and earlier.

| Field | Field Type | Description |
| --- | --- | --- |
| criteriaBasedRules | [CaseCriteriaBasedSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_cbsrule.htm#CaseCriteriaBasedSharingRule-BA7F0AE0)\[\] | List that defines user criteria-based rules. |
| ownerRules | [CaseOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_ownersharingrule.htm#CaseOwnerSharingRule)\[\] | List that defines user membership-based rules. |

## ContactSharingRules

Represents the sharing rules for contacts. It extends the SharingRules metadata type and inherits its fullName field. Only available in API version 32.0 and earlier.

| Field | Field Type | Description |
| --- | --- | --- |
| criteriaBasedRules | [ContactCriteriaBasedSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_cbsrule.htm#ContactCriteriaBasedSharingRule-BA7FB5C9)\[\] | List that defines user criteria-based rules. |
| ownerRules | [ContactOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_ownersharingrule.htm#ContactOwnerSharingRule)\[\] | List that defines user membership-based rules. |

## LeadSharingRules

Represents the sharing rules for leads. It extends the SharingRules metadata type and inherits its fullName field. Only available in API version 32.0 and earlier.

| Field | Field Type | Description |
| --- | --- | --- |
| criteriaBasedRules | [LeadCriteriaBasedSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_cbsrule.htm#LeadCriteriaBasedSharingRule-BA7FDBAF)\[\] | List that defines user criteria-based rules. |
| ownerRules | [LeadOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_ownersharingrule.htm#LeadOwnerSharingRule)\[\] | List that defines user membership-based rules. |

## OpportunitySharingRules

Represents the sharing rules for opportunities. It extends the SharingRules metadata type and inherits its fullName field. Only available in API version 32.0 and earlier.

| Field | Field Type | Description |
| --- | --- | --- |
| criteriaBasedRules | [OpportunityCriteriaBasedSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_cbsrule.htm#OpportunityCriteriaBasedSharingRule-BA801C92)\[\] | List that defines user criteria-based rules. |
| ownerRules | [OpportunityOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_ownersharingrule.htm#OpportunityOwnerSharingRule)\[\] | List that defines user membership-based rules. |

## AccountTerritorySharingRules

Represents the sharing rules for account territories in the original territory management feature. It extends the SharingRules metadata type and inherits its fullName field. Only available in API version 32.0 and earlier.

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d864512e1010">Field</th>

              <th class="featureTableHeader  " id="d864512e1013">Field Type</th>

              <th class="featureTableHeader  " id="d864512e1016">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d864512e1010" data-title="Field"><span class="keyword parmname">rules</span></td>

              <td class="entry" headers="d864512e1013" data-title="Field Type">
                <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_ownersharingrule.htm#AccountTerritorySharingRule">AccountTerritorySharingRule</a>[]
              </td>

              <td class="entry" headers="d864512e1016" data-title="Description">List that defines user membership-based rules. The list of
                acceptable values for the <span class="keyword parmname">sharedFrom</span> fields
                are: <ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">territory</samp></li>

                  <li class="li"><samp class="codeph nolang">territoryAndSubordinates</samp></li>

                </ul>
              </td>

            </tr>

          </tbody>

        </table>

## CustomObjectSharingRules

Represents the sharing rules for custom objects. It extends the SharingRules metadata type and inherits its fullName field. Only available in API version 32.0 and earlier.

| Field | Field Type | Description |
| --- | --- | --- |
| criteriaBasedRules | [CustomObjectCriteriaBasedSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_cbsrule.htm#CustomObjectCriteriaBasedSharingRul-BA809B38)\[\] | List that defines user criteria-based rules. |
| ownerRules | [CustomObjectOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_ownersharingrule.htm#CustomObjectOwnerSharingRule)\[\] | List that defines user membership-based rules. |

## UserSharingRules

Represents the sharing rules for users. With user sharing rules, you can share members of a group with members of another group. It extends the SharingRules metadata type and inherits its fullName field. Only available in API version 32.0 and earlier.

| Field | Field Type | Description |
| --- | --- | --- |
| criteriaBasedRules | [UserCriteriaBasedSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_cbsrule.htm#UserCBSRule)\[\] | List that defines user criteria-based rules. |
| membershipRules | [UserMembershipSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_ownersharingrule.htm#UserMembershipSharingRule)\[\] | List that defines user membership-based rules. |

## Declarative Metadata Sample Definition

For retrieving sharing rules, see package.xml sample at SharingRules.

The following sample XML definition represents a criteria-based sharing rule in API version 33.0.

<?xml version="1.0" encoding="UTF-8"?>
<SharingRules xmlns="http://soap.sforce.com/2006/04/metadata">
    <sharingCriteriaRules\>
        <fullName\>AccountCriteriaShareWithCEO</fullName\>
        <accessLevel\>Edit</accessLevel\>
        <accountSettings\>
            <caseAccessLevel\>Read</caseAccessLevel\>
            <contactAccessLevel\>Edit</contactAccessLevel\>
            <opportunityAccessLevel\>Edit</opportunityAccessLevel\>
        </accountSettings\>
        <criteriaItems\>
            <field\>Name</field\>
            <operation\>startsWith</operation\>
            <value\>Test</value\>
        </criteriaItems\>
        <description\>my account criteria rule description</description\>
        <label\>AccountCriteriaShareWithCEO</label\>
        <sharedTo\>
            <role\>CEO</role\>
        </sharedTo\>
    </sharingCriteriaRules\>
</SharingRules\>

The following sample XML definition represents an ownership-based sharing rule in API version 33.0.

<?xml version="1.0" encoding="UTF-8"?>
<SharingRules xmlns="http://soap.sforce.com/2006/04/metadata">
    <sharingOwnerRules\>
        <fullName\>MyCase</fullName\>
        <accessLevel\>Edit</accessLevel\>
        <description\>my case test owner sharing rule desc</description\>
        <label\>MyCase</label\>
        <sharedFrom\>
            <role\>COO</role\>
        </sharedFrom\>
        <sharedTo\>
            <role\>CEO</role\>
        </sharedTo\>
    </sharingOwnerRules\>
</SharingRules\>

The following sample XML definition represents a territory-based sharing rule in API version 33.0.

<?xml version="1.0" encoding="UTF-8"?>
<SharingRules xmlns="http://soap.sforce.com/2006/04/metadata">
    <sharingTerritoryRules\>
        <fullName\>MyAccountTerritoryRule</fullName\>
        <accessLevel\>Read</accessLevel\>
        <accountSettings\>
            <caseAccessLevel\>None</caseAccessLevel\>
            <contactAccessLevel\>Read</contactAccessLevel\>
            <opportunityAccessLevel\>None</opportunityAccessLevel\>
        </accountSettings\>
        <description\>MyAccountTerritoryRule desc</description\>
        <label\>MyAccountTerritoryRule</label\>
        <sharedFrom\>
            <territory\>My\_territory</territory\>
        </sharedFrom\>
        <sharedTo\>
            <role\>CEO</role\>
        </sharedTo\>
    </sharingTerritoryRules\>
</SharingRules\>

The following is the definition of two account owner-based sharing rules in API version 32.0 and earlier. The file name corresponds to Account.sharingRules under the accountSharingRules directory. In this definition, ownerRules corresponds to [AccountOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_ownersharingrule.htm#AccountOwnerSharingRule).

<?xml version="1.0" encoding="UTF-8"?>
<AccountSharingRules xmlns="http://soap.sforce.com/2006/04/metadata">
    <ownerRules\>
        <fullName\>G1Dev\_G2New</fullName\>
        <sharedFrom\>
            <group\>G1Dev</group\>
        </sharedFrom\>
        <sharedTo\>
            <group\>G2New</group\>
        </sharedTo\>
        <accountAccessLevel\>Read</caseAccessLevel\>
        <caseAccessLevel\>None</caseAccessLevel\>
        <contactAccessLevel\>Read</contactAccessLevel\>
        <name\>G1Dev\_G2New</name\>
        <opportunityAccessLevel\>Edit</opportunityAccessLevel\>
    </ownerRules\>
    <ownerRules\>
        <fullName\>G2New\_R1New</fullName\>
        <sharedFrom\>
            <group\>G2New</group\>
        </sharedFrom\>
        <sharedTo\>
            <roleAndSubordinates\>R1New</roleAndSubordinates\>
        </sharedTo\>
        <accountAccessLevel\>Edit</accountAccessLevel\>
        <caseAccessLevel\>Read</caseAccessLevel\>
        <contactAccessLevel\>Edit</contactAccessLevel\>
        <name\>G2New\_R1New</name\>
        <opportunityAccessLevel\>None</opportunityAccessLevel\>
    </ownerRules\>
</AccountSharingRules\>

The following is the definition of a user criteria-based sharing rule and a user membership-based sharing rule in API version 32.0 and earlier. The file name corresponds to User.sharingRules under the userSharingRules directory.

<?xml version="1.0" encoding="UTF-8"?>
<UserSharingRules xmlns="http://soap.sforce.com/2006/04/metadata">
    <criteriaBasedRules\>
        <fullName\>shareUsers2</fullName\>
        <sharedTo\>
            <group\>Asia\_Division</group\>
        </sharedTo\>
        <criteriaItems\>
            <field\>FirstName</field\>
            <operation\>equals</operation\>
            <value\>John</value\>
        </criteriaItems\>
        <name\>shareUsers2</name\>
        <userAccessLevel\>Read</userAccessLevel\>
    </criteriaBasedRules\>
    <membershipRules\>
        <fullName\>shareUsers1</fullName\>
        <sharedTo\>
            <group\>South\_America\_Division</group\>
        </sharedTo\>
        <sharedFrom\>
            <group\>Asia\_Division</group\>
        </sharedFrom\>
        <name\>shareUsers1</name\>
        <userAccessLevel\>Read</userAccessLevel\>
    </membershipRules\>
</UserSharingRules\>

The following shows a sample package.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types\>
        <members\>ObjA\_\_c.\*</members\>
        <name\>SharingCriteriaRule</name\>
    </types\>
    <types\>
        <members\>ObjA\_\_c.\*</members\>
        <name\>SharingOwnerRule</name\>
    </types\>
    <version\>68.0</version\>
</Package\>

## Wildcard Support in the Manifest File

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](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/file_based_zip_file.htm "The deploy() and retrieve() calls are used to deploy and retrieve a .zip file. Within the .zip file is a project manifest (package.xml) that lists what to retrieve or deploy, and one or more XML components that are organized into folders.").

1. [BaseSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_basesharingrule.htm)  
    This component is removed as of API version 33.0 and is available in earlier versions only. Use SharingBaseRule instead. Represents the base container for criteria-based and owner-based sharing rules.
2. [CriteriaBasedSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_cbsrule.htm)  
    This component is removed as of API version 33.0 and is available in earlier versions only. Use [SharingRules](# "Represents the base container for sharing rules, which can be criteria-based, ownership-based, territory-based, or for guest user access. SharingRules enables you to share records with a set of users, using rules that specify the access level for the target user group.") instead. Represents a criteria-based sharing rule. CriteriaBasedSharingRule enables you to share records based on specific criteria.
3. [OwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_ownersharingrule.htm)  
    Represents an ownership-based sharing rule. OwnerSharingRule enables you to share records owned by a set of users with another set, using rules that specify the access level of the target user group. This component is removed as of API version 33.0 and is available in earlier versions only.