Let us create 2 entities Parent Entity and Child
Entity having 1 – n relationship.
Here we will be creating Entity List for Child Entity that displays all the child entity records associated to Parent Entity to which user has access to.
This we can achieve using Child Entity Permission record for the Child Entity.
First let us define an Entity List for Parent Entity to which we will enable Entity Permission with Global Scope.
Next let us create Entity Permission for Parent Entity and assign it to one of the web role associated to the current Portal Contact user.
For simplicity, we are keeping the Scope as Global. We can also use Contact and Account scope here for filtering the access to the records if that Entity is associated with the Contact Entity. Based on which the Child entity records will further get filtered.
The above Entity Permission gives access to all the records (Global – Read) of Parent Entity to the portal user.
Now let us create an Entity List for Child Entity and enable Entity Permissions.
Configure the below Actions Create, Details, Edit and Delete.
To configure the above Actions we would need an Entity Form, so before we do that we need to create an Entity Form for Child Entity.
Next configure a web page to display the Child Entity Entity List.
Now comes the important part i.e. creating child entity permission for Child Entity.
Create an Entity Permission Record with the below details :
Scope – Parent
Parent Entity Permission – Entity Permission created for Parent Entity i.e. Entity Permission Parent Entity.
Parent Relationship – the 1 – n relationship we created between Parent Entity and Child Entity.
Now opening the page which has the Entity List defined for Child Entity, we can see the below 3 records associated to the parent records to which user has the Read access.
We do not see the all the records as not all the child entity records are associated to the parent entity’s record.
Hope it helps..