In CRM Portal, we can control the records using entity permission based on privileges, but it will be specific to Web Role not specific to the particular logged in user in Portal.

This blog post demonstrates how to control the record based on the specific portal logged-in user.

Let’s take the following scenario: Primary contact in Account Entity can only edit the record details in CRM Portal. In order to achieve this, please follow the below solution steps.

How to Customise Security in CRM Portal/Adxstudio Using Liquid Template

Step 1: Create a new web template as ‘Edit Account Details Web Template and add the Liquid Template code.

liquid template code

Liquid Template Code:

 

Step 2: Create a new page template as ‘Edit Account Details Page Template and select the ‘Edit Account Details Web Template

Edit Account Details Web Template

 

Step 3: Create a new entity form for Edit Account Details; please check the below for more details.

create new entity form

 

Step 4: Create a new web page and select ‘Edit Account Details Page Template’ and entity form as ‘Edit Account Details

Edit Account Details

 

In CRM, select Account. Primary contact should be Portal logged-in user and try to edit in the Portal. Below example will allow only ‘Sathis K’ Portal user to edit account.

Customise Security in CRM Portal Adxstudio Using Liquid Template

 

In Portal, log in with ‘Sathis K’ and select the Edit group details in partial URL. For example: https://sample.microsoftcrmportals.com/edit-account-details/?id=DCC81791-A615-E711-8104-C4346BC540C4

edit group details

 

Now in Portal, try to log in with another user and try to edit the account details:

https://sample.microsoftcrmportals.com/edit-account-details/?id=DCC81791-A615-E711-8104-C4346BC540C4

It will redirect to Access Denied page because only primary contact is allowed to edit the details.

access denied page