---
schema_version: "1"
id: 27f57ddea32acae030dbd2d76f6693bd720c4a64218e457c6f4c513ff9af17f8
title: PermissionSetLicenseDefinition
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_permissionsetlicensedefinition.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_permissionsetlicensedefinition.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 013db0b20b3d6526da61e14bfe81313c9af1ec2e216627cc8ed097fd861da8f6
description: Represents the definition of a custom permission set license, which entitles specified features in a package.
---
# PermissionSetLicenseDefinition

Represents the definition of a custom permission set license, which entitles specified features in a package.

## Parent Type

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.

## File Suffix and Directory Location

PermissionSetLicenseDefinition components have the suffix .permissionSetLicenseDefinition and are stored in the permissionSetLicenseDefinitions folder.

## Version

PermissionSetLicenseDefinition components are available in API version 66.0 and later.

## Fields

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



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

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

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

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d744684e98" data-title="Field Name"><span class="keyword parmname">componentAccess</span></td>

              <td class="entry" headers="d744684e101" data-title="Field Type">enum</td>

              <td class="entry" headers="d744684e104" data-title="Description">Required. How licensed components are accessed. Valid values are: <a name="ul_fyn_5md_tjc"><!-- --></a>
                <ul class="ul bulletList" id="ul_fyn_5md_tjc">
                  <li class="li"><samp class="codeph nolang">None</samp></li>

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

                </ul>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d744684e98" data-title="Field Name"><span class="keyword parmname">customObjects</span></td>

              <td class="entry" headers="d744684e101" data-title="Field Type"><a class="xref" href="#PermissionSetLicenseDefinitionCustomObject">PermissionSetLicenseDefinitionCustomObject</a></td>

              <td class="entry" headers="d744684e104" data-title="Description">A licensed custom object with CRUD access included in the permission set
                license definition. </td>

            </tr>

            <tr>
              <td class="entry" headers="d744684e98" data-title="Field Name"><span class="keyword parmname">customPermissions</span></td>

              <td class="entry" headers="d744684e101" data-title="Field Type"><a class="xref" href="#PermissionSetLicenseDefinitionCustomPermission">PermissionSetLicenseDefinitionCustomPermission</a></td>

              <td class="entry" headers="d744684e104" data-title="Description">An array of licensed custom permissions included in the permission set license
                definition.</td>

            </tr>

            <tr>
              <td class="entry" headers="d744684e98" data-title="Field Name"><span class="keyword parmname">defaultTrialLengthInDays</span></td>

              <td class="entry" headers="d744684e101" data-title="Field Type">int</td>

              <td class="entry" headers="d744684e104" data-title="Description">Required. Default trial length in days.</td>

            </tr>

            <tr>
              <td class="entry" headers="d744684e98" data-title="Field Name"><span class="keyword parmname">defaultTrialLicenseCount</span></td>

              <td class="entry" headers="d744684e101" data-title="Field Type">int</td>

              <td class="entry" headers="d744684e104" data-title="Description">Required. Default number of trial licenses provisioned for a trial.</td>

            </tr>

            <tr>
              <td class="entry" headers="d744684e98" data-title="Field Name"><span class="keyword parmname">label</span></td>

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

              <td class="entry" headers="d744684e104" data-title="Description">Required. The name of the permission set license definition.</td>

            </tr>

            <tr>
              <td class="entry" headers="d744684e98" data-title="Field Name"><span class="keyword parmname">licenseExpirationPolicy</span></td>

              <td class="entry" headers="d744684e101" data-title="Field Type">LicenseExpirationPolicy (enumeration of type string)</td>

              <td class="entry" headers="d744684e104" data-title="Description">The license expiration policy of the custom permission set license. Valid
                values are:<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">BlockNamespaceAccess</samp>—Package
                    access is blocked for existing users when all custom permission set licenses
                    expire. This is the default value.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">AllowNamespaceAccess</samp>—Package
                    access isn’t blocked for existing users when all custom permission set licenses
                    expire.
                  </li>

                </ul>
                This field is available in API version 55.0 through 64.0. Removed in API
                version 65.0 and later.</td>

            </tr>

            <tr>
              <td class="entry" headers="d744684e98" data-title="Field Name"><span class="keyword parmname">userLicenseRestrictions</span></td>

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

              <td class="entry" headers="d744684e104" data-title="Description">The user license categories that can be assigned the custom permission set
                license. If no user license categories are specified, all users can be assigned the
                license. Possible values include:<ul class="ul bulletList">
                  <li class="li"><samp class="codeph nolang">${communities}</samp></li>

                  <li class="li"><samp class="codeph nolang">${communitiesLogin}</samp></li>

                  <li class="li"><samp class="codeph nolang">${customerCommunities}</samp></li>

                  <li class="li"><samp class="codeph nolang">${customerCommunitiesLogin}</samp></li>

                  <li class="li"><samp class="codeph nolang">${internal}</samp></li>

                  <li class="li"><samp class="codeph nolang">${partnerCommunity}</samp></li>

                  <li class="li"><samp class="codeph nolang">${partnerCommunityLogin}</samp></li>

                  <li class="li"><samp class="codeph nolang">${platform}</samp></li>

                </ul>
                <p class="p">For more information, see <a class="xref" href="https://developer.salesforce.com/docs/platform/isvforce/guide/gtm-app-psl-understand.html" target="_blank">Understand Permission Set
                    Licenses</a></p>
              </td>

            </tr>

          </tbody>

        </table>

## PermissionSetLicenseDefinitionCustomObject

Represents one licensed custom object and the CRUD permissions the license grants.

| Field Name | Field Type | Description |
| --- | --- | --- |
| allowCreate | boolean | Allows created access. |
| allowDelete | boolean | Allows delete access. |
| allowRead | boolean | Allows read access. |
| allowUpdate | boolean | Allows update access. |
| name | string | Required. The label of the licenced custom object. Must include the \_\_c suffix in the metadata. For example: Widget\_\_c. The value is stored internally without the suffix, with the value added on retrieve. |

## PermissionSetLicenseDefinitionCustomPermission

Represents a licensed custom permission included in the permission set license definition.

| Field Name | Field Type | Description |
| --- | --- | --- |
| name | string | Label of the licensed custom permission. This field must be a reference to a [CustomPermission](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_custompermission.htm "Represents a permission that grants access to a custom feature. This type extends the Metadata metadata type and inherits its fullName field.") that has the isLicensed field set to true. |

## Declarative Metadata Sample Definition

The following is an example of a PermissionSetLicenseDefinition component.

<?xml version="1.0" encoding="UTF-8"?>
<PermissionSetLicenseDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
    <componentAccess\>Namespace</componentAccess\>
    <customObjects\>
        <allowCreate\>false</allowCreate\>
        <allowDelete\>false</allowDelete\>
        <allowRead\>true</allowRead\>
        <allowUpdate\>false</allowUpdate\>
        <name\>Widget\_\_c</name\>
    </customObjects\>
    <defaultTrialLengthInDays\>30</defaultTrialLengthInDays\>
    <defaultTrialLicenseCount\>10</defaultTrialLicenseCount\>
    <label\>Base</label\>
    <userLicenseRestrictions\>${internal}</userLicenseRestrictions\>
</PermissionSetLicenseDefinition\>

The following is an example package.xml that references the previous definition.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types\>
        <members\>\*</members\>
        <name\>PermissionSetLicenseDefinition</name\>
    </types\>
    <version\>66.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.").