cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdamH
Post Patron
Post Patron

Restrict users to see specific records

Hi All, 

 

I'm trying to improve an application I made that hides certain records from staff if there user email is not hard coded into the app - I have been using [on visible] varUserEmail = ect. 

 

I have created a SP list which will contain the users email / their name and a selection of YES / NO choice options which acts as their level of access, such as Generic User, Manager, MST and so on.  I would like to be able to use the choice options to be able to restrict what records they can see. 

2021-09-11 20_38_34-Window.png

 

I have also created another SP List which will contain the records I want to restrict to certain users - It follows a similar selection of YES / NO choice fields

2021-09-11 20_42_20-Window.png

The test record above, will be available to Generic Users, Managers, SPUC and MST. If the user above in the first Image logs into the app they will be able to see this record. 

 

How would I accomplish something like that?

 

Thanks 

15 REPLIES 15

@WarrenBelz 

 

How would I put your example to the test in a gallery? 

 

@AdamH ,

I was only giving you a structure based on what you posted for a Variable. As both of us are trying to point out to you, your data structure does not lend itself to this exercise. You can easy do it with a better structure in one list.

Thanks @WarrenBelz @v-jefferni 

 

How would you guys structure a SP list for this type of application then?

@AdamH ,

This is only my personal preference as I subscribe to Keep It Simple, but I do something very similar with my users (about 250 of them) where I have one list with all their authorities in field values. One lookup only is required and sets either a Text, Numeric  or Boolean variable at App OnStart which follows through to anything I want them to do or see.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

Thanks @WarrenBelz - Do you know of any working examples I can see with a similar setup?  

I remember you saying a long time ago (in another post) that you did something like this - I would just need to see an example of a SP list with your layout to see if it's something I can use in my app. 

 

If you don't have any examples, don't worry

Hi @AdamH ,

It is simply a list of all users with fields representing various authorities/permissions. I collect the entire user record at App OnStart in a Variable

Set(
   varUserAuth,
   LookUp(
      StaffList,
      EmailField = User().Email
   )
)

then varUserAuth.PermissonFieldName can be tested whenever you need to.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,667)