PermissionSetLicenseDefinition

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

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

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

Version 

Introduced in API version 66.0.

Fields 

componentAccess 

  • Type: PsldComponentAccess (enumeration of type string)
  • Required: Yes
  • Description: Required. How licensed components are accessed.
  • Possible values:
    • None
    • Namespace

customObjects 

customPermissions 

defaultTrialLengthInDays 

  • Type: int
  • Required: Yes
  • Description: Required. Default trial length in days.

defaultTrialLicenseCount 

  • Type: int
  • Required: Yes
  • Description: Required. Default number of trial licenses provisioned for a trial.

label 

  • Type: string
  • Required: Yes
  • Description: Required. The name of the permission set license definition.

licenseExpirationPolicy 

  • Type: LicenseExpirationPolicy (enumeration of type string)
  • Required: No
  • Version: This field is available in API version 55.0 through 64.0.

Removed in API version 65.0 and later.

  • Description: The license expiration policy of the custom permission set license.
  • Possible values:
    • AllowNamespaceAccess — Package access isn’t blocked for existing users when all custom permission set licenses expire.
    • BlockNamespaceAccess — Package access is blocked for existing users when all custom permission set licenses expire. This is the default value.

userLicenseRestrictions 

  • Type: string (enumeration of type string)

  • Required: No

  • 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:

    For more information, see Understand Permission Set Licenses

  • Possible values:

    • ${communities}
    • ${communitiesLogin}
    • ${customerCommunities}
    • ${customerCommunitiesLogin}
    • ${internal}
    • ${partnerCommunity}
    • ${partnerCommunityLogin}
    • ${platform}

PermissionSetLicenseDefinitionCustomObject Type 

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

Fields 

allowCreate 

  • Type: boolean
  • Required: No
  • Description: Allows created access.

allowDelete 

  • Type: boolean
  • Required: No
  • Description: Allows delete access.

allowRead 

  • Type: boolean
  • Required: No
  • Description: Allows read access.

allowUpdate 

  • Type: boolean
  • Required: No
  • Description: Allows update access.

name 

  • Type: string
  • Required: Yes
  • Description: 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 Type 

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

Fields 

name 

  • Type: string
  • Required: Yes
  • Description: 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.