Query Entity Permissions for a portal user using Liquid in PowerApps portals/ Dynamics 365 Portals

Follow my blog for more interesting topics on Dynamics 365, Portals and Power Platform. For training and consulting, write to us at info@xrmforyou.com

Entity permissions are a great way to control record access in your Dynamics 365 Portals. You can have fine grained control at individual record level. But ever wondered if you can determine the portal user privileges on a particular record that the portal user is viewing? Cometh the hour, cometh the champion, our very own liquid in Dynamics 365 Portals.

Using liquid you can determine the permission a portal user is having on a record they are viewing. Let’s see how we can accomplish the same.

For this demo, I have created a sample Web Template. Before I go ahead and show you the template code, below are the configurations that I made.

1. Created a portal user

2. Assigned a web role to the portal user

3. Provided Entity permission to the web role for contact entity. Screenshot below. Please note I haven’t provided “Append To” permission.

image

Below is the code for my web template

As you can see, the entity liquid tag has permissions object. And the permissions object have properties like can_create, can_read etc. to check for user privileges on the record.

When I run the page for a specific contact, below is output.

image

As you can see “Can Append To” is false because I haven’t provided append to permissions in the Entity permission.

Hope this helps!

Debajit Dutta

(Microsoft MVP)