PermissionSetLicenseDefinition

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

Parent Type

This type extends the Metadata 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

Field Name Field Type Description
componentAccess enum Required. How licensed components are accessed. Valid values are:
  • None
  • Namespace
customObjects PermissionSetLicenseDefinitionCustomObject A licensed custom object with CRUD access included in the permission set license definition.
customPermissions PermissionSetLicenseDefinitionCustomPermission An array of licensed custom permissions included in the permission set license definition.
defaultTrialLengthInDays int Required. Default trial length in days.
defaultTrialLicenseCount int Required. Default number of trial licenses provisioned for a trial.
label string Required. The name of the permission set license definition.
licenseExpirationPolicy LicenseExpirationPolicy (enumeration of type string) The license expiration policy of the custom permission set license. Valid values are:
  • BlockNamespaceAccess—Package access is blocked for existing users when all custom permission set licenses expire. This is the default value.
  • AllowNamespaceAccess—Package access isn’t blocked for existing users when all custom permission set licenses expire.
This field is available in API version 55.0 and later.
userLicenseRestrictions string 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:
  • ${communities}
  • ${communitiesLogin}
  • ${customerCommunities}
  • ${customerCommunitiesLogin}
  • ${internal}
  • ${partnerCommunity}
  • ${partnerCommunityLogin}
  • ${platform}

For more information, see User License Restriction Categories (Developer Preview). This field is available in API version 55.0 and later.

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 that has the isLicensed field set to true.

Declarative Metadata Sample Definition

The following is an example of a PermissionSetLicenseDefinition component.

1<?xml version="1.0" encoding="UTF-8"?>
2<PermissionSetLicenseDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
3    <componentAccess>Namespace</componentAccess>
4    <customObjects>
5        <allowCreate>false</allowCreate>
6        <allowDelete>false</allowDelete>
7        <allowRead>true</allowRead>
8        <allowUpdate>false</allowUpdate>
9        <name>Widget__c</name>
10    </customObjects>
11    <defaultTrialLengthInDays>30</defaultTrialLengthInDays>
12    <defaultTrialLicenseCount>10</defaultTrialLicenseCount>
13    <label>Base</label>
14    <userLicenseRestrictions>${internal}</userLicenseRestrictions>
15</PermissionSetLicenseDefinition>

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

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>*</members>
5        <name>PermissionSetLicenseDefinition</name>
6    </types>
7    <version>66.0</version>
8</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.