Skip to main content

Resolving validation errors - "Permission <xxx> depends on permission(s): <yyy>"

Cause and solution to the alidation error "Permission <xxx> depends on permission(s): <yyy>" which is surfaced during PR or deployment package validation.

Mateusz Kochanowicz avatar
Written by Mateusz Kochanowicz
Updated this week

Error overview

You may run into this error when deploying metadata items such as Profile.

Example of the error message in Gearset:
"Permission Edit Case Comments depends on permission(s): Edit Case"

It's possible that Profile you're deploying references a user permission (e.g. Case Comments), however a successful deployment of that permission (Case Comments) depends on the Profile also having enabled Edit Case user permission.

Explanation of the error

In the context of this Salesforce validation error that Gearset is surfacing, <xxx> is the API name for the user permission. Whereas <yyy> is the names of the permission(s) needed for a successful deployment.

Usually, this is auto-enabled when higher level permissions are being granted.

However, when deploying profiles from version control system (e.g. GitHub etc), then the higher level permission may be missed. This is when Salesforce would surface this error on the deployment.

Resolution

Workaround for validations run via Compare and deploy

The resolution for this error is to edit the affected user permissions and grant them the <yyy> permissions.

Or if the user permission already has those permissions, try using the default profiles filter:

Workaround for failed PR validations in Gearset Pipelines

If you're running into this error in your Gearset Pipeline, consider the following steps to fix the issue:

  • Make an additional commit into the feature branch (from which the PR was opened), and add a missing permission.

  • You can do it from the Pipelines page by selecting your Dev Sandbox, then selecting the correct feature branch from the drop down, and clicking on commit more changes button.

  • Once the missing permission is committed to your feature branch, re-validate the PR in the Pipeline. This should allow the validation to pass.

Note: If your PR is pending against the final Pipeline environment (usually Prod), or had already been merged into at least one lower environment, you'll need to ensure that the missing permission added to your feature branch gets correctly propagated into all the lower Pipeline environments. This can be achieved via a Sync PR option after you've merged your PR into Prod (final environment).

Other resources

Further examples of this Salesforce validation error can be found here:
​Salesforce Stack Exchange

Disclaimer: This error is returned by Salesforce directly, rather than Gearset. Even so, we offer guidance based on our combined experience with the Metadata API. Where possible, we try to help guide you to fix or avoid this error. In the case that this isn't possible, we may need to direct you to Salesforce support for further clarification.

Did this answer your question?