I am trying to add profiles to our repository and use that to deploy to different orgs. The problem I'm dealing with is that each org has different user permissions and a user permission may work in one org but not the other. This gets even more complicated when there are other dependencies on user permissions. For example, I want to deploy "ModifyAllData" for a profile. It works in org A; however, I see the error below when I try to deploy it to org B:
Error: Permission ModifyAllData depends on permission(s): DeleteTopics, EditPublicDocuments, EditPublicFilters, EditPublicReports, EditPublicTemplates, ImportLeads, ManageCategories, ManageDashboards, ManageNetworks, SolutionImport, TransferAnyEntity, TransferAnyLead, UseTeamReassignWizards
Then when I add "EditPublicReports" to my repository, I cannot save it to Org A because it gives me the following error:
unknown user permission "EditPublicReports".
I know I can manually fix these up before deploying but I'm hoping to find a universal and automatic solution to this instead of having to manually get involved. How can I do it?