cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jeyaram19
New Member

Entity permission

Hi All,

 

I have used entity permissions to restrict access to the custom entities records.

 

Is there any option to expose only selective fields from a record in edit mode and retaining the rest of the fields in read only mode.

 

Thanks,

KJ

2 REPLIES 2
justinburch
Microsoft
Microsoft

Hi @Jeyaram19,

Is your goal to change these fields based on the user's permissions/web role? If not, then just change the fields to "Read Only" (Lock Field) in your form editor - the Portal will honor this. Ideally, you're already using a copy of your standard form for the Portal anyway.

Otherwise, consider using the tips on my blog (https://justinburch.com/portal-security-3/ - scroll down to the "Web Template" sample) to have multiple Entity Forms/Web Forms that are chosen based on Web Role (instead of a field), which each point to a different actual form or form tab (if you aren't showing multiple tabs currently).

Hi @Jeyaram19 

 

Another way you can achieve this is via JavaScript, you can get the user roles using JS/Liquid and then set the fields enabled/disabled:

$(document).ready(function () {

    var roles = "{{ user.roles }}";
    var isAdmin = "{{ user | has_role: 'Administrators' }}"

    console.log("Is Admin: " + isAdmin);
    console.log("User Roles: " + roles);

});

Note that this method might be simpler, but taking a quick look at the method proposed by @justinburch, it seems to be safer, so just take that into account


------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Pages Super User | MVP


Oliver Rodrigues


 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (1,828)