[SalesForce] Can’t deploy org-wide permission set with ant

I have created an org-wide permission set (i.e. not tied to a specific User License type) and am trying to deploy the permission set using ant (I just downloaded the latest .jar file, 26.0) but I'm getting the following error:

Permission set must be associated to a user license

Is this because the salesforce ant library doesn't support org-wide permission sets or am I doing something wrong on my side (i.e. does anyone have a counter example of this working) ?

Best Answer

I have not been able to replicate this error. In a dev org I created an empty Permission Set with the User License set to none. I then retrieved it via Ant, deleted it from the org via the UI and then deployed it back via Ant.

My package.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>PermissionSet</name>
    </types>
    <version>26.0</version>
</Package>

My permission set's XML:

<?xml version="1.0" encoding="UTF-8"?>
<PermissionSet xmlns="http://soap.sforce.com/2006/04/metadata">
    <label>GlobalTest</label>
    <userPermissions>
        <enabled>false</enabled>
        <name>ActivateContract</name>
    </userPermissions>
    <!-- All userPermissions were false; snipped for brevity -->
    <userPermissions>
        <enabled>false</enabled>
        <name>ViewSetup</name>
    </userPermissions>
</PermissionSet>

Perhaps you have some permission that is conflicting?

Related Topic