6

I am trying to deploy permission set with only one permission included: AllowViewEditConvertedLeads.

I've created the unlocked package, and put this permission set there. Then, when I install this package to scratch org or sandbox, permission set is present, but without needed permission.

What could be the reason?

4
  • What is this permission about? A custom object? A custom field? Or is it a custom permission? Commented Oct 28, 2020 at 12:36
  • @RenatoOliveira it is userPermission AllowViewEditConvertedLeads
    – afphultl
    Commented Oct 28, 2020 at 12:36
  • So the permission set is actually deployed, but the permission is not active on it? Commented Oct 28, 2020 at 12:49
  • @RenatoOliveira exactly
    – afphultl
    Commented Oct 28, 2020 at 12:54

2 Answers 2

7

The link from @xedshot (https://help.salesforce.com/articleView?id=distribution_perm_sets_profile_settings.htm&type=5) is correct and relevant, but I feel that it's worth quoting and explaining the relevant section:

The following list is given under the title "What permissions and settings are included?" for Permission Sets:

  • Assigned custom apps
  • Custom object permissions
  • External object permissions
  • Custom field permissions
  • Custom metadata types permissions
  • Custom permissions
  • Custom settings permissions
  • Custom tab visibility settings
  • Apex class access
  • Visualforce page access
  • External data source access
  • Record types

The consequence is that you can build a Permission Set in a package which contains some things on the list, and some things not on the list. This will build with no errors or warnings. However, on package install, only the items from the list will be created/updated in the target org.

So, suppose I have a permission set which includes the system permissions for "API Enabled" and "Apex REST Services", plus Apex class access for my Apex REST class.

When I install this into an org that has never had my package before, the Permission Set is created, but it only enables the Apex class. It does not also set "API Enabled" and "Apex REST Services".

If I set those extra permissions after install, subsequent upgrades will keep my changes.

So, it is a bit of a gotcha for working with unlocked packaging.

0

The reason is that you can not include App permissions into permission set with unlocked package.

3
  • Would you mind sharing some official Salesforce documentation in this reference (if you have found any)?
    – arut
    Commented Nov 4, 2020 at 10:09
  • @arut help.salesforce.com/…
    – afphultl
    Commented Nov 6, 2020 at 17:58
  • This link only indicates whether permission sets & profiles can be upgraded via managed package. Nothing related to its inclusion/ deployment in unlocked package.
    – arut
    Commented Nov 7, 2020 at 4:36

You must log in to answer this question.

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