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 Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,183)