Syncing profile permissions with Salesforce

salesforce

#1

Hello!

I’ve been using Cloud9 for some Salesforce development, pushing to a sandbox and also committing to version control using BitBucket. However, I’ve noticed that profile settings (in particular, access to objects) is not pulled from Salesforce. This makes deployment later on difficult, and it also means that these settings can’t be included in version control.

Any plans to make this available?


#2

Hi, list of synced objects is controlled by package.xml
Opening that file should open a tree with checkboxes allowing to pick which objects to sync.


#3

Hi, yes I’m aware of package.xml and have all entries enabled. But profiles and object permissions don’t get synced.


#4

Could you tell me how to set these permissions from salesforce so that i could test why it doesn’t work.


#5

Hi, here you go:

Setup -> Manage Users -> Profiles -> Select a custom profile -> Edit button -> Scroll to “custom object permissions” section


#6

Could you try using open in text editor button and adding

    <types>
        <members>*</members>
        <name>Profile</name>
    </types>

seems like xml editor doesn’t show all the available fields


#7

Adding that and syncing added a “profiles” folder, but there are no contents.


#8

Any thoughts on this?


#9

@JeremyHiggs I think the data in profiles is dependent on which objects are listed in package.xml. According to Salesforce’s documentation about common migration issues:

Profiles or permission sets and field-level security — The contents of a retrieved profile or permission set depend on the other contents of the retrieve request. For example, field-level security for fields included in custom objects are returned at the same time as profiles or permission sets. For more information, see Profile and PermissionSet in the Metadata API Developer Guide.

My guess would be that you have to include all types you plan to deploy in the file. As a side effect, this means they will also by synchronized to Cloud9 which may or may not be what you want.


#10

Hi xoob, thanks for the tip. All object types are selected in the package.xml file, so there shouldn’t be any reason why none of the profiles are synced across. (Permission sets do seem to be synced, or at least the ‘Lightning User’ one.)


#11

Hi Guys,

Did anyone come up with an answer to this one? I’m having the same issue.

Here’s my package.xml:

<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>*</members> <name>ApexClass</name> </types> <types> <members>*</members> <name>ApexComponent</name> </types> <types> <members>*</members> <name>ApexPage</name> </types> <types> <members>*</members> <name>ApexTrigger</name> </types> <types> <members>*</members> <name>AuraDefinitionBundle</name> </types> <types> <members>*</members> <name>CustomMetadata</name> </types> <types> <members>*</members> <name>CustomObject</name> </types> <types> <members>*</members> <name>Profile</name> </types> <version>37.0</version> </Package>

Although I do get a Profiles folder, it’s empty.

I’ve copy/pasted the same package.xml into Eclipse and it pulls all of the profiles down without any issues.

Any ideas?


#12

Hello, yes I am finding the same and therefore causing issues with deployments down the line.

Please can someone from C9 give an official response to this one. Thanks