Although the Salesforce Metadata Coverage documentation states that the Profile metadata type is supported for packaging, Profiles in Salesforce Packages have special installation behavior that differs from other metadata types. When a package that includes Profiles is installed in a target org, the Profile itself is never installed directly. Instead, the behavior depends on how the package is installed and which installation option is selected. This article explains the different installation methods and what happens to packaged Profiles in each scenario.
When installing a package through the Salesforce Setup UI using the install link, you are presented with three options: Install for Admins Only, Install for All Users, or Install for Specific Profiles.
If you select Install for Specific Profiles, you can map the values of the packaged Profile to an existing Profile in the target org. This profile mapping allows the package's permissions and settings to be applied to a specific existing Profile in the subscriber org. The documentation for installing packages describes this mapping behavior, and the values that can be mapped to existing Profiles are listed in the profile settings documentation.
If you select Install for Admins Only or Install for All Users, the Profiles included in the package are not used during installation.
The Salesforce CLI package installation command (force:package:install) supports only two options: Install for Admins Only and Install for All Users. The Install for Specific Profiles option — which enables profile mapping — is only available through the UI installer. This means that automating profile value mapping during package installation is not currently possible using the CLI.
The CLI installation command defaults to Install for Admins Only. Use the --securitytype parameter to specify Install for All Users if needed.
When creating a package version using the Salesforce CLI, any Profile properties in the included Profiles that are not related to the packaged metadata are automatically removed from the Profile during the package version creation process.
Install for Admins Only grants full CRUD (Create, Read, Update, Delete) access to the packaged metadata — such as Custom Objects and Tabs — only to the System Administrator Profile in the subscriber org.
Install for All Users applies the same CRUD access to Custom Objects to all Profiles in the subscriber org. However, note that CRUD access to Custom Objects is still only fully granted for the System Administrator Profile.
A recommended workaround for managing access as part of a package is to use Permission Sets instead of Profiles. Permission Sets are better supported in packaging and offer more flexibility for distributing access across subscriber orgs.
000380781

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.