Loading

Profile Metadata is Overwritten after Deployment

게시 일자: Jun 6, 2023
상세 설명

If you deploy profile metadata using DevOps Center, Salesforce CLI deploy-retrieve library, Metadata API, or other tools, you can accidentally overwrite the profile due to how profiles are structured. To reduce the risk of overwriting or deleting profile contents, we recommend that you use permission sets instead.

솔루션

The contents requested in the RetrieveRequest message determine the profile or permission set contents that the Metadata API returns. For example, profiles only include field-level security for fields included in custom objects returned in the same RetrieveRequest as the profiles. Likewise, when a profile is deployed, all of its permissions, custom objects, fields, and page layouts must be manually included; otherwise, they’re removed from the profile .xml file. This behavior can lead to issues where profiles are overwritten when deploying updates.

We recommend that you use permission sets instead of profiles to manage user access and permissions. While permission sets and profiles have the same behavior for retrieve and deploy calls, permission sets are in general more contained, which makes it easier to manage their included settings and permissions. Permission sets allow you to grant users only the permissions they need in a more granular, flexible manner than profiles. You can also bundle permission sets into permission set groups to streamline permission assignment and management.

Use permission sets to manage:

  • Apex classes
  • Connected app access
  • Custom permissions
  • Field permissions
  • Object permissions
  • User permissions (app permissions and system permissions)
  • Tab settings
  • Visualforce pages

Use profiles to manage:

  • Default apps and record types
  • IP ranges
  • Login hours
  • Page layout assignment

Note: You can add profiles to your project's .forceIgnore file so that they’re ignored when pulling changes.


See also:

Knowledge 기사 번호

000395615

 
로드 중
Salesforce Help | Article