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 Apps Portals Super User


Oliver Rodrigues


 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Users online (30,495)