---
schema_version: "1"
id: b664f3c0bcadf7de28708f2e3af7ce12339533805d66fabe70bf4c1f957da732
title: SharingBaseRule
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_sharingbaserule.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_sharingbaserule.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 54d927a29575486ca63bb7fe60930dc0c0188e985fbe7ff60c3a33cd1db3d101
description: Represents sharing rule settings such as access level and to whom access is granted.
---
# SharingBaseRule

Represents sharing rule settings such as access level and to whom access is granted.

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.

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

#### Note

You can’t create a [SharingBaseRule](#meta_sharingbaserule "Represents sharing rule settings such as access level and to whom access is granted.") component directly. Use the components under [SharingRules](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_sharingrules.htm "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.

## Version

[SharingBaseRule](#meta_sharingbaserule "Represents sharing rule settings such as access level and to whom access is granted.") replaces [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.") and is available in API version 33.0 and later.

## Fields

| Field | Field Type | Description |
| --- | --- | --- |
| accessLevel | string | Required. The access level that the sharing rule grants. |
| accountSettings | [AccountSharingRuleSettings](#AccountSharingRuleSettings)\[\] | The access level for the account’s children (case, contact, and opportunity). |
| description | string | Describes the sharing rule. Maximum of 1000 characters. |
| label | string | Required. Label for the sharing rule. |
| sharedTo | [SharedTo](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_sharedto.htm "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.") | Required. Specifies who the record is shared with. |

## AccountSharingRuleSettings

Defines the access level for the case, contact, and opportunity associated with the account.

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



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

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

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

            </tr>

          </thead>

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

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

              <td class="entry" headers="d863681e235" data-title="Description">Required. The access level that the user or group has to cases associated with the
                account. Possible values are:<ul class="ul bulletList">
                  <li class="li">None</li>

                  <li class="li">Read</li>

                  <li class="li">Edit</li>

                </ul>
              </td>

            </tr>

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

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

              <td class="entry" headers="d863681e235" data-title="Description">Required. The access level that the user or group has to contacts associated with the
                account. Possible values are:<ul class="ul bulletList">
                  <li class="li">None</li>

                  <li class="li">Read</li>

                  <li class="li">Edit</li>

                </ul>
              </td>

            </tr>

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

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

              <td class="entry" headers="d863681e235" data-title="Description">Required. The access level that the user or group has to opportunities associated with
                the account. Possible values are:<ul class="ul bulletList">
                  <li class="li">None</li>

                  <li class="li">Read</li>

                  <li class="li">Edit</li>

                </ul>
              </td>

            </tr>

          </tbody>

        </table>

## Wildcard Support in the Manifest File

This metadata type doesn’t support 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.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).