function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
benedwards44benedwards44 

Deploying a Profile Update via Tooling RESP API - INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY

I was wondering if anyway has ever been able to make updates to Profiles via the Tooling REST API?

I have recently built an application which creates CustomFields via the API, and I would then like to update profiles with permissions to those new fields. Fields are deploying fine using a POST to the CustomField resource, however I'm unable to update any profiles using a PATCH request as per the Tooling API documentation.

I have tried numerous examples of a profile update, but I am returned INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY - insufficient access rights on cross-reference id: 00eb0000000hlse.

Where the ID is the ID of my profile I'm trying to update.

I am posting my request to the URL:https://eu2.salesforce.com/services/data/v33.0/tooling/sobjects/Profile/00eb0000000hlseAAA

Where eu2 is my instance and 00eb0000000hlseAAA is my Profile ID. That all works as expected, including for other resources (CustomFIeld, ApexClass etc).

My data payload - I have tried numerous examples:

Example 1 - Update field permission
{
	'Metadata': {
		'fieldPermissions': [
			{
				'field': 'Account.Email__c',
				'editable': True,
				'readable': True
			}
		]
	}
}
Example 2 - Simple Update to Description
{
	'Metadata': {
		'description': 'Test description'
	}
}
I've tried different Metadata examples - including querying for the profile and then simply re-submitting it - but still receive the error.

I've tried different profiles, different fields and many different permissions.

Any help would be appreciated. I understand the Profile object has only been available since Winter '15 so I'm starting to consider it's just not supported as per the documentation.

I'm looking at you Andy Fawcett...