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)

Published by

Debajit

I am a Dynamics CRM Most Valuable Professional (MVP) with 12 years of experience in Microsoft .NET Technologies and 9 years of dedicated experience in Microsoft Dynamics CRM. I have worked with companies like Microsoft, SanDisk, PwC, TMF Group and have extensive experience of implementing complex CRM solutions from both offshore and client side. Currently the face of XrmForYou.com with significant experience in delivering corporate training on Dynamics CRM and have already delivered multiple projects to client through XrmForYou.com Author of multiple tools on codeplex including the 'Role Based Views' and 'CRM-Sharepoint Metadata manager & Attachment Extractor' which are available for commercial use under XrmForYou.com For consulting/ training, drop me a note at info@xrmforyou.com or visit our website www.xrmforyou.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s