+ Start a Discussion
Michael Robert 19Michael Robert 19 

Lightning recordEditForm not rendering for read only user

Lightning recordEditForm will not render anything if the logged in user has only read permission based on data-level security.

I have a custom object that is a child of Opportunity so its data-level security is controlled by its parent (Opportunity) sharing settings.

All of my user Profiles have Object-level permissions set to Read/Write on the child object and I rely on data-level security (sharing settings) to determine which users can read and which can write the child object.
I created a custom Aura component for this object with a lightning:recordEditForm component and a lightning:inputField.

I would expect the recordEditForm to render for all users but only allow the users with read/write permssion to save changes. In fact, the inputField will not render at all for the read-only user. The Save button will render but not the input field.

The recordEditForm form works fine for the read/write user.
If I replace the entire lightning:recordEditForm with a lightning:recordViewForm the read-only user can see the data but now the read/write users cannot edit it.
I was expecting that I could use the same recordEditForm for all users and allow data-level security settings to control who can make changes.

The standard record detail page works correctly: all of the fields are visible to both users but only the users with read/write permission can save changes. So I know that the sharing settings are working as expected. I would like the lightning:recordEditForm to behave the same as the record detail page.

Has anybody encountered this problem before? Your help is much appreciated.
It is working as expected.

UI API responses also respect CRUD access, field-level security settings, and sharing settings. This means that the framework displays only records and fields for which users have CRUD access and FLS visibility. You get all these features by using the Lightning Data Service wire adapters (lightning/ui*Api) and the components built on it.


Magulan Duraipandian