cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
praneshJ
Helper II
Helper II

How to achieve row level security in power apps portal

Hello,

I want to achieve row-level security in my power apps portal application. I have 4 users, from which 3 of then are associated with one site each. and I have one superuser named Alex,  mentioned in the below screenshot, who has the access to all the sites

 

please check the below screenshot.

praneshJ_0-1600241731991.png

 

When John logs in to the portal using his credentials, he should see only Site Lily details,
Mike logs in to the portal using his credentials, he should see only Site Rose details,

but when Alex logs in to the portal he must see all three sites Lily, Rose, Lotus

 

How do I achieve this in the power apps portal?

 

Any kind of quick help is really appreciated!!

 

Regards,

Pranesh

6 REPLIES 6
OliverRodrigues
Super User II
Super User II

Hi

 

I think actually that might be easier than it looks, have you looked into Entity Permissions?: https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/assign-entity-permissions

 

the only trick here is that you will need to create two entity permissions for the same entity, but linked to a different Contact relationship (I am assuming users / super user are two different lookup to the Contact entity)

when having multiple permissions, the Portals should combine and give the show all results


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

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


 

praneshJ
Helper II
Helper II

I have achieved row-level security in the entity list on the web page, 

I have the site column in my entity list and that is getting filtered correctly based on the logged-in user. I have enabled Create functionality with the entity list, and when I click on the create button, it opens ups the create form, in that form, there is a site lookup field, but it is not getting filtered as the logged-in user instead, it showing all the sites in the lookup field, irrespective of the user logged in. 
I need to filter that site lookup field on the Create form as well,

 

what is the best possible way to achieve it?

 

Quick help is really appreciated! 

 

take a look at this article: https://www.dancingwithcrm.com/custom-lookup-filtering-powerapps-portal/

you need a bit of code but it is straight forward enough

 


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

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


 

Hi @praneshJ,

I'm going to paraphrase, please let me know if anything here is wrong:

You have a view showing All Site records. With proper Entity Permissions, this list correctly only shows Site records where the logged in user is associated to the Site - in your example, John, Mike and Smith each see one Site, Alex (Global Read) sees all. When John, Mike, or Smith click the Create button, you open a Create entity form to create a new Site record, and this record has a self-referential lookup to a Site record, but this lookup allows each to see more than their own Site.

Is this correct?

Hi @justinburch,

 

Thanks for the reply,

yes, it's correct as you mentioned, but the create form opens for creating a new record for 'site activity', and the site is a lookup field,

as shown in the image below,

praneshJ_0-1600405895892.png

and that site lookup field is not getting filtered according to the logged-in user.
when John, Mike, and Smith logs in to the portal application, they should see the only site associated with them.
and when Alex logs in, He should see the all sites.

 

Please let me know if I am able to clarify your doubt.

 

Please comment on this.

Thanks @praneshJ, I had a feeling this was the case. With this knowledge, I believe your issue is in your Entity Permissions. As I don't know the relationships, I'm making some assumptions with this proposed set of Web Roles & Permissions:

  1. Superuser Web Role
    1. Site Activity Entity Permission
      1. Global Read, Append, Append To
    2. Site Entity Permission
      1. Global Read, Append, Append To
  2. Standard Web Role
    1. Site Activity Entity Permission
      1. Contact-Based
      2. On Relationship: Contact lookup on Site Activity
      3. Read, Write, Append, Append To, Create
    2. Site Entity Permission
      1. Parent-Based
      2. On Relationship: Site Lookup on Site Activity
      3. Read, Append, Append To

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (46,770)