Menu
D365
P L A Y T I M E
D365
P L A Y T I M E

Applying Entity Permissions to Liquid data on Entity Forms (Liquid only)

Posted on July 18, 2019July 26, 2019

I’ve read online in a few places that liquid applies entity permissions before displaying data to users all the time. This is only the case in Dynamics Portal not ADX Portal. So anyway, if you’re in a situation where you are planning on displaying data to a user and you find entity permissions are not being adhered to here’s an easy way to keep everything in order.

In the below example I’m pulling up an entity form based on a custom entity called role, there is an entity reference field on the role pointing to a contact record. I am presenting that contact records information within this entity form but first ensuring it is secure. I am wrapping any data I want secured into an IF statement which only fires if the user has permission to view those details using the permissions object.


//Assign the ID of the role 
{% assign roleString = request.params['id'] %}

// Assign the custom role entity so I can access the entity reference field gg_role
{% assign role = entities.gg_role.[roleString] %}

//Assign the contact entity using the entity reference field gg_role
{% assign contact = entities.contact.[role.gg_contact.Id] %}

//Run code if the user;s entity permissions would allow them to
{% if contact.permissions.can_read == true %}

/// All assigning of variables and personal information goes here
{% endif %}

// Thats it

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Retrieve the GUID of a record or Entity Reference within a workflow
  • How to find workflows that run a particular child workflow
  • Error when adding an Entity into Data Export Service that has been included before
  • How to sum / roll up rollup fields
  • Custom Workflow Step to calculate age

Recent Comments

    Archives

    • December 2020
    • June 2020
    • March 2020
    • October 2019
    • September 2019
    • July 2019
    • May 2019
    • March 2019
    • January 2019

    Categories

    • Custom Workflows
    • Data Export Service
    • dotmailer-connector
    • Dynamics Portal
    • Jquery/JS
    • UUI
    • Workflows
    ©2021 Dynamics 365 Playtime