Skip to main content

Hi,

We have created a User that has the Salesforce Integration License so it only has access to the API and not the UI, under the "Permission Set License Assignments" on the user we set the "Salesforce API Integration" permissions which basically states that it gives access to "Active Scratch Orgs: Read, Create, Edit, Delete" but when ever we try to create a scratch org with the given user through the Salesforce CLI we get this error:

"The specified org DevHub is not a Dev Hub."

The funny part is that when we use a personal System Admin user it works just perfectly fine and we do the complete procedure exactly the same way.

So we does it not work for a Salesforce Integration Licensed User with the correct permissions, what are we doing wrong?

Dev Hub is enabled and again as said it works fine with my personal admin user but not optimal to use my personal user for a CI setup and IMO a user with restricted only API access would be the optimal solution to use for this tell me if I am wrong.

3 Antworten
  1. 14. Apr. 2023, 07:56

    Hi Vinay,

    Thanks for you answer I have seen that help page and didn't give me much xD. Anyway I have actually made it work after days of trial an error approaches. Found this feed

    https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000Oqk3DSAR

     

    which hinted me a bit in a right direction. So what I have done to actually make it work is the following:

    1. I created a custom Permission Set
    2. In the Object Settings I edit the "Active Scratch Orgs" to give permissions to `Read, Create, Edit, Delete` (Did it as well for the Scratch Org Infos Object but don't think it's necessary)
    3. Then on the "System Permissions" settings for my custom Permission Set I enable the "View Setup and Configuration" (which will auto enable "View Roles and Role Hierarchy" just kept it but think this can be removed if necessary) based on the feed I linked to above.
    4. I assign my Salesforce Integration Licened User to have that new custom Permission Set and then it works as supposed to, I can now use that User for our CI to create Scratch Orgs.

    Hi Vinay,Thanks for you answer I have seen that help page and didn't give me much xD. Anyway I have actually made it work after days of trial an error approaches.

    User-added image

     

    This worked for me!

    I did add the Salesforce API Integration permission set license in the first place which was supposedly the only thing I would need but I can say that it does not work you have do add a Custom Permission Set to make it work. The Salesforce API Integration Permission Set has a section where it is stated "Allows users access to Salesforce data and features only through the Salesforce API." that you need to enable and if you look at the "Object Permissions" section of that property then you will find this "Active Scratch Orgs: Read, Create, Edit, Delete" statement which means as I understand it that you give permissions to create scratch org just enabling this property in the build in Salesforce API Integration Permission Set but it simply does not work, adding the same object permissions on a Custom Permisson Set does the trick for us, which is weird I a believe that that might be a bug in Salesforce I guess?

    Regards

    Nedim
0/9000