Profile defines permissions, login restrictions, and application settings for users assigned to it. It combines object and field access, access to Apex classes, Visualforce pages and flows, record-type availability, layout assignments, and system permissions. userLicense establishes the baseline features available to the profile; custom distinguishes custom profiles from standard profiles.
A retrieved Profile is not necessarily a complete security configuration. Most access settings depend on the other components included in the same retrieve request. Deployment also updates selected settings rather than replacing the entire target profile. These behaviors matter when copying profiles, comparing environments, or revoking permissions.
Key Elements
| Element | What the Element Controls |
|---|---|
userLicense |
The user license that establishes the profile's baseline features. License compatibility matters when copying permissions to a replacement profile. |
custom |
Whether the profile is custom (true) or standard (false). |
objectPermissions |
Object access through allowCreate, allowRead, allowEdit, and allowDelete; broader access through viewAllRecords, modifyAllRecords, and viewAllFields. |
fieldPermissions |
Field-level security through field, readable, and editable. Required-field permissions cannot be retrieved or deployed. |
userPermissions |
App or system permissions, identified by name and controlled by enabled. Retrieval returns only enabled permissions. |
classAccesses |
Execution access to methods in named top-level Apex classes through apexClass and enabled. |
pageAccesses |
Access to named Visualforce pages through apexPage and enabled. |
flowAccesses |
Access to named flows through flow and enabled. This does not configure a login flow. |
loginFlows |
The business process presented before Salesforce access. uiLoginFlowType is VisualWorkflow or VisualForce, with different required references. |
loginHours |
Login days and times using paired daily elements such as mondayStart and mondayEnd. An explicitly empty element removes existing restrictions. |
loginIpRanges |
Permitted login address ranges, each with required startAddress and endAddress values. |
applicationVisibilities |
App visibility and the default app through separate visible and default settings. Only one app per profile can have default=true. |
tabVisibilities |
Tab navigation visibility: DefaultOff, DefaultOn, or Hidden. It does not replace object permissions. |
recordTypeVisibilities |
Record-type availability and creation defaults through visible, default, and, when applicable, personAccountDefault. |
layoutAssignments |
The layout assigned for an entity, optionally matched to a recordType. Layout assignment is separate from field-level security. |
Behavior and Constraints
Object, field, and component access
Ordinary object permissions and sharing bypasses serve different purposes:
-
viewAllRecordsgrants read access to all records of the object regardless of sharing, including private records. -
modifyAllRecordsgrants read, edit, and delete access to all records of the object regardless of sharing. -
viewAllFieldsgrants read access to all fields and field data for the object, rather than only individually permitted fields.
Not every object supports viewAllRecords or modifyAllRecords. A profile with "View All Data" ignores its viewAllRecords entries without returning an error. A profile with "Modify All Data" similarly ignores modifyAllRecords entries. A successful deployment therefore does not prove that the narrower object setting controls the user's effective access.
You cannot edit objectPermissions for standard objects on standard profiles.
Field-level security controls whether a field is readable or editable. Its deployment rules include these exceptions:
- Permissions for required fields cannot be retrieved or deployed.
- For a newly deployed custom field,
readableandeditabledefault tofalse. This creation default does not describe what omission does when updating an existing field. - Reference shared Activity fields through
EventorTask, such asEvent.Meeting__c. - Metadata API can make some fields editable even when the user interface does not allow that change.
Asset.ProductCodeis a documented example.
classAccesses, pageAccesses, and flowAccesses grant component access separately from object and field permissions. Granting flow access does not make that flow a login flow; loginFlows configures that association.
customMetadataTypeAccesses and customSettingAccesses govern read access to records of the named custom metadata types and custom settings. externalDataSourceAccesses applies to external data sources whose identity type is Per User.
Login restrictions and login flows
loginIpRanges restricts the addresses from which assigned users can log in. These restrictions are separate from component permissions and application visibility.
loginHours restricts login days and times. Each specified day requires both its Start and End values. Values are strings containing minutes since midnight, must be divisible by 60, and must satisfy Start less than or equal to End. For example, 300 represents 5:00 AM and 1020 represents 5:00 PM.
An unspecified login-hours configuration imposes no profile login-hours restriction. However, omitting loginHours from an update does not remove restrictions already in the target. To remove them, supply an empty <loginHours/> element with no start or end values.
A login flow directs users through a business process before they access Salesforce. Its requirements depend on uiLoginFlowType:
-
VisualWorkflowrequiresflowto identify aFlow. That Flow must already be deployed and have statusActivebefore the login-flow definition is deployed. -
VisualForcerequires bothvfFlowPageandvfFlowPageTitle. - The login-flow type value must be
UI, and a friendly name is required. The spelling differences for these elements are described under Documentation Inconsistencies. -
useLightningRuntimeapplies only toVisualWorkflowand defaults tofalse.
Applications, record types, and layouts
applicationVisibilities supports standard and custom apps. Visibility and default-app selection are separate settings, and only one app can be the profile's default.
Tab visibility controls navigation:
-
DefaultOffmakes the tab available through All Tabs. Users can customize their display to show it in apps. -
DefaultOnalso displays the tab in its associated app. Users can customize that display. -
Hiddenremoves the tab from All Tabs and app navigation.
recordTypeVisibilities controls record-type availability and creation defaults. Record types can select different business processes, picklist values, and page layouts. The recordType value is object-qualified, such as Account.MyRecordType. Visibility settings for inactive record types are neither retrieved nor deployed.
personAccountDefault identifies the default person-account record type only when Person Accounts is enabled. Otherwise, it has no effect.
A layoutAssignments entry selects a layout for an entity and can additionally match a record type. One profile can therefore use different layouts for records of different types. This assignment does not replace field-level security.
Profile-specific Lightning Home page assignments belong to CustomApplication and require a corresponding app assignment. They are not deployed as Home page overrides contained in Profile.
Administrative access
"View Setup and Configuration" is required to view profile settings such as object and field permissions, layout assignments, record types, and related setup configuration. Customer Portal and Partner Portal users cannot access this metadata type.
When Profile Filtering is enabled, viewing profile names other than the caller's own requires appropriate permissions. Authorized tab and record-type assignment wizards, login-flow configuration, and delegated-administration tasks can still expose profile names.
Deployment and Retrieval
Metadata API stores one .profile file per profile in the profiles folder. Profile supports the * wildcard in package.xml, the manifest that selects components for a metadata operation.
Retrieval is scoped to the request
Most Profile access settings are returned only for components included in the same retrieve request. userPermissions, loginIpRanges, and loginHours are exceptions retrieved independently of the other component selections.
- Field permissions: include the relevant objects or fields in the same request. Retrieving Profile alone does not produce comprehensive field-level security.
-
Standard objects: a
CustomObjectwildcard includes custom objects, not standard objects. Include a standard object explicitly, such asAccountas aCustomObjectmember, to retrieve its profile permissions. -
Individual fields: select a
CustomFieldmember such asAccount.MyCustomField__cwhen retrieving permissions for that field. - Standard tabs: include the corresponding standard object in the manifest to retrieve standard-tab visibility.
-
Relationship fields: use the relationship name without
Idin the manifest. For example, selectContact.Account, notContact.AccountId.
Retrieval also filters permission entries: userPermissions and customPermissions return only enabled permissions, and objectPermissions entries return only when allowRead=true. An absent entry is not an explicit denial.
An app-focused retrieve can still return system permissions, login hours, and IP ranges. Deploying that output can transport those settings as well as the selected app-related settings.
Deployment overlays existing settings
Profile deployment updates the supplied settings over the target's existing configuration. It does not replace the entire profile. Removing a permission entry from a file is not equivalent to revoking that permission.
To transport disablement, explicitly supply false in the applicable permission element. For example, a named userPermissions entry uses enabled=false. This distinction matters when comparing sparse exports or trying to reproduce a source profile exactly.
If a target profile does not exist and the deployment specifies no permissions or settings, Salesforce creates it with the permissions and settings of Minimum Access - Salesforce. It is not completely empty. To create a custom profile starting with only permissions required by its user license, use the Profile object. That object is a separate API surface from the Profile metadata type.
Access settings for managed Apex classes, apps, custom fields, custom objects, custom tabs, external data sources, record types, Visualforce pages, and login flows can be retrieved and deployed.
For login flows, Metadata API supports defining and editing associations. Delete login-flow definitions through the Login Flow setup page; do not treat an omitted loginFlows entry as a deletion.
The active-Flow prerequisite for a login-flow association establishes a deployment sequence. Other references alone do not establish a mandatory deployment order.
Relationships
Profile access and assignment entries name independently defined components. A layout assignment paired with a record type is a combined assignment, while a login-flow association additionally requires an already active Flow.
Incoming references connect profiles to authentication, registration, sites, applications, sharing, delegated administration, and operational configuration. ProfilePasswordPolicy and ProfileSessionSetting hold password and session configuration separately from Profile login hours and IP ranges. Name-based dependencies, such as formula comparisons against $Profile.Name, are separate from these structured references.
References
-
ApexClass:classAccesses.apexClass. -
ApexPage:pageAccesses.apexPage,loginFlows.vfFlowPage. -
CustomApplication:applicationVisibilities.application. -
CustomField:fieldPermissions.field. -
CustomObject:objectPermissions.object,customMetadataTypeAccesses.name,customSettingAccesses.name. The latter two identify custom metadata type and custom setting definitions. -
CustomPermission:customPermissions.name. -
CustomTab:tabVisibilities.tab. -
DataCategoryGroup:categoryGroupVisibilities.dataCategoryGroup. -
ExternalDataSource:externalDataSourceAccesses.externalDataSource. -
Flow:flowAccesses.flow,loginFlows.flow. -
Layout:layoutAssignments.layout. -
RecordType:recordTypeVisibilities.recordType,layoutAssignments.recordType.
Referenced By
-
AdvAccountForecastSet:profileName,userProfileName. -
Audience:profile. -
AuthProvider:flowDefaultProfile. -
ConnectedApp:profileName. -
CustomApplication:profile. -
CustomObject:profileName. -
CustomSite:guestProfile. -
DelegateGroup:profiles. -
LiveChatAgentConfig:profile. -
Network:profile,registrationUserDefaultProfile,selfRegProfile. -
OmniSupervisorConfig:profile. -
Portal:selfRegUserDefaultProfile. -
PortalDelegablePermissionSet:profile. -
PresenceUserConfig:profile. -
ProfilePasswordPolicy:profile. -
ProfileSessionSetting:profile. -
Prompt:rightValue. -
SearchCustomization:selectedProfile. -
SharingSet:profiles. -
Skill:profile. -
TimeSheetTemplate:assignedTo.
Documentation Inconsistencies
Element spelling differs between the exposed element schema and Salesforce's Profile reference. Within loginFlows, the schema exposes flowType and friendlyName, while the reference labels them flowtype and friendlyname.
The schema also exposes genComputingSummaryDefAccesses and servicePresenceStatusAccesses, while the reference lists genComputingSummaryDefAccess and ServicePresenceStatusAccesses. These case and pluralization differences matter when interpreting or constructing serialized metadata.
Reported Issues
-
A license migration may require a replacement profile. Community reports describe unsuccessful in-place changes to an existing profile's
userLicense. A March 2024 follow-up describes copying the metadata, changing the license, and deploying it under a different profile name. The permissions had to be compatible with the new license, and the responder still encountered unresolved standard-object deployment issues. This is a reported technique, not a guaranteed migration procedure. See the profile license discussion. -
An unknown user permission can indicate a target-feature mismatch. In a 2022-2023 production-deployment discussion,
Unknown user permission: ShareFilesWithNetworkswas reportedly resolved by removing "Share Files with People in Experience Cloud sites" from the source profile. Another responder reported enabling Experiences in the target when a standard profile did not allow the permission to be unchecked. The result depended on target feature configuration. See the deployment error discussion. -
Literal standard-profile names can make validation logic language-dependent. A 2016 diagnosis attributed unexpected comparisons against
$Profile.Nameand "System Administrator" to translation of standard profile names under a non-English company default language. This creates a name-based dependency outside explicit Profile reference elements. See the validation-rule discussion. - A permission-set Edit grant may not provide write access to a particular record. In a 2012 private-Opportunity scenario, a user could see the Edit action but could not edit the record. Responders distinguished permission sets, which supplement profile grants, from the separate requirement for record-level write access through sharing. This is an access-diagnosis case, not an explanation for every access failure. See the profile and sharing discussion.
- App-visibility change sets may update only the permissions for included components. A discussion updated in 2015 reported adding the app as a change set component and selecting profiles under Profile Settings. It also reported errors for profiles missing from the target and a limitation on standard applications in change sets. The responder used Metadata API for standard-app visibility and warned that retrieving the app with its profile could also transport app changes and general profile settings. See the app-visibility deployment discussion.
Common Questions
Why are field permissions missing from my Profile retrieve?
Most Profile access settings depend on the components selected in the same request. Include the relevant objects or fields. A CustomObject wildcard excludes standard objects, so explicitly include objects such as Account. Required-field permissions cannot be retrieved.
Does deleting a permission from a Profile file revoke it?
No. Deployment overlays existing target settings. To transport disablement, explicitly set the applicable permission value to false. An absent export entry is not an explicit denial.
How do I remove login hours from a Profile?
Deploy an explicitly empty <loginHours/> element with no start or end values. Omitting loginHours from an update leaves existing restrictions in place.
Why does deploying a minimal Profile create permissions I did not specify?
When the target profile does not exist and no permissions or settings are specified, Salesforce uses Minimum Access - Salesforce as the baseline. Creating a custom profile through the separate Profile object starts with only permissions required by its user license.
What must exist before I deploy a Profile login flow?
For uiLoginFlowType=VisualWorkflow, the referenced Flow must already be deployed and have status Active. For VisualForce, supply vfFlowPage and vfFlowPageTitle. Ordinary flowAccesses entries do not configure login flows.