Introduction
In this article, we are going to discuss how we can configure Dynamics 365 portal Web Roles and entity permission to access the entity data based on the system's N:N relationship. We are using Dynamics 365 trial and provisioned portal trial.
Please refer to my earlier article for setting up Dynamics 365 trial if you want to set up a Dynamics 365 trial. Also, you can refer to
this KB to provision the portal in your trial.
Requirement
Let’s say we have setup following custom N:N relationship between Account and Contact, so that multiple partner contacts can be associated to partner account and similarly partner account can be connected to multiple partner contacts.
Now, we need to configure the entity permission so that the current portal user (partner contact) can access all the associated partner accounts where he is either primary contact or a partner contact.
Solution
We can create a new web role or can use an existing web role to set entity permissions. Let’s create a new web role, navigate to Portal->Web Roles and Click on New.
Let’s use “Partner Portal User” under the name field and select your portal website, keep other fields as default and hit Save.
Once it is saved, click on the V sign next to Partner Portal User web role and select entity permissions.
Click on the New button to add entity permissions.
Fill entity permission form like following and click on Save and Close, here we are using Contact scope and selecting our N:N relationship under Contact relationship.
Similarly, we can set up another entity permission to allow access partner account based on the primary contact relationship like the following.
Add Existing Web Role
Add this Contact to an existing account as a primary contact or create a new account and set this contact as the primary contact. Now, when we navigate to the portal with this new contact, we will be able to see one Account based on the primary contact relationship like the following.
Let’s go back to Dynamics 365 CE and open any Existing Account, let say Adventure Works associate current portal user to this account using N:N relationship. Now when we will go back to the portal, we should be able to see two Customers like the following.
So this way we can configure entity permissions for 1:N and N:N relationship for Portal. Stay tuned for more Dynamics 365 Contents !!