3

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) ?

4
  • boards.developerforce.com/t5/General-Development/… Just to help you up i googled this .Loooks like you may use Dataloader for this . Commented Nov 23, 2012 at 17:31
  • Have you used Ant to retrieve the permission set or did you hand code it?
    – Mike Chale
    Commented Nov 23, 2012 at 17:43
  • @MohithKumar - You should probably post that as an answer.
    – Mike Chale
    Commented Nov 23, 2012 at 17:43
  • @MikeChale The Permission set was created through the Web UI and retrieved via ANT, but remains undeployable.
    – Mike Ginou
    Commented Nov 26, 2012 at 15:33

3 Answers 3

2

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?

1
  • Interesting. I'll try to simplify my scenario to match.
    – Mike Ginou
    Commented Nov 26, 2012 at 15:49
1

http://boards.developerforce.com/t5/General-Development/how-to-deploy-App-Permissions/m-p/439553#M70207

You can use the dataloader to achieve this .You can extract in a CSV and use this to upload .

1
  • This does work, in a pinch. However, you can't upsert on the permission set name, which makes it a real pain (need to do manual id matching between orgs)
    – Mike Ginou
    Commented Nov 26, 2012 at 15:47
1

There shouldn't be a reason why you can't deploy an org-wide permission set through ANT.

Make sure that:

  1. the user license element is left off the [org-wide] .PermissionSet xml altogether (no need to set <userLicense> and in fact, by adding an empty element: <userLicense></userLicense>, you will receive an error: Required field is missing: userLicense which may be interpreted in ANT as "Permission set must be associated to a user license"

  2. make sure that, if updating an existing org-wide permission set in the target org, that it's not already assigned to a user where you would encounter a validation issue with a permission that the assigned user shouldn't have (e.g. platform users can't be assigned delete on opportunities or the assignment will fail).

If you are still encountering a problem, please file a case with Customer Support and reference this stackexchange thread so that I can address it when the case is escalated to my team in salesforce R&D.

Thanks!

AT

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .