Hi
I'm currently building an app that manages inventory within a lab and there is a need to restrict who can edit and delete items to the person who is listed as responsible, their line manager and people who are 'super users'.
To control who can edit and delete, I would like base it off of the following depending on who is logged in to the app. I know this won't affect people's ability to go into the sharepoint list and edit but that's not really a concern. I have the following 2 fields in place that are people pickers:
1. 'Person Responsible'
2. 'Line Manager'
There is also then a seperate list that contains people who are super users and that is connected to the app too.
Effectively, I'm trying to make it so that the 2 buttons below don't appear to anyone for the item unless they are listed as the person responsible or line manager within the item, or they are on the super user list.
What would be the best way to go about this?
Assuming that you are getting to this page from a Gallery and that in that Gallery you are setting some sort of variable to be used for your form screen, then you can utilize the following for the DisplayMode property of those icons.
With({_user:Lower(User().Email)},
If(Lower(yourRecordVariable.'Person Responsible'.Email) = _user ||
Lower(yourRecordVariable.'LineManager'.Email) = _user,
Disabled,
Edit
)
)
You only need this in one of the icon DeisplayMode properties and then the other can reference that one. Example, you put this in the Edit icon DisplayMode, then you can set the DisplayMode property of the Delete icon to yourEditIcon.DisplayMode
I hope this is helpful for you.
Thanks for the help.
I am navigating to this screen from a Gallery, but what do you mean by variable for the form screen? Just to put it into context.
User | Count |
---|---|
260 | |
110 | |
98 | |
56 | |
40 |