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