Guest users are unable to render apex:inputField when "Secure Guest User Record Access" is enabled
Last updated 15 days ago ·Reference W-7513345 ·Reported By 60 users
When "Secure Guest Record Access (https://help.salesforce.com/articleView?id=networks_secure_guest_user_sharing.htm&type=5)" is enabled, Visualforce components using apex:inputField will render the input field in disabled mode for guest users. Guest user profile requires at least Edit permission on that salesforce object and field - even if the data provider apex controller has “without sharing”
*Sample Use Case*
There might be use cases where a guest user require Edit access on a record but the guest profile does not have Create or Edit permissions on the object. In such cases guest users can access the record using an apex controller with “without sharing” keyword and override the profile’s Object Permissions . However, if the Visualforce page using such a controller has apex:inputField then the input field would still appear disabled.
1. Enable Secure Guest User Record Access. (https://releasenotes.docs.salesforce.com/en-us/winter20/release-notes/rn_networks_guest_user_access.htm)
2. Create a Visualforce page to edit a Salesforce Object using apex:inputField with an apex controller using “without sharing”
3. Go to guest user profile
* For Sites - Setup > Sites > Your Site > *Public Access Settings*
* For Communities - Experience Builder > Settings > General > *Guest User Profile*
4. Give guest user access to this page from GuestUserProfile > *Enabled Visualforce Page Access*
5. Disable *Edit* from *Object Permissions *for that Salesforce Object
*This issue has been fixed. *
The new ignoreEditPermissionForRendering attribute on <apex:inputField> allows you to override entity edit permissions for users, even when the underlying permission on the object doesn’t allow edits.
*See **release notes for details:* https://releasenotes.docs.salesforce.com/en-us/winter21/release-notes/rn_networks_entity_input_field_update_228.htm
*Additional Documentation*: Apex guide https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_inputField.htm
Reported By (60)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.