Hello,
Is there a way to reload /exit app for user that have rights taken away?
I have a button function:
Remove(ListaAdmin,Gallery4.Selected);UpdateContext({showDialogAdmin:false});Notify("Administrator został usunięty!",NotificationType.Success)
with this I delete admins - but this works after next user session (app reload).
ListaAdmin is a sharepoint list with a field people that lists all users with particular rights (admins). It loads the list of users onStart of application.
Set(gblUserEmail,User().Email);Set(varAdmin1,false);Set(
varAdmin,
!IsBlank(
LookUp(
ListaAdmin,
'Dane administratora'.Email=gblUserEmail
)
)
)
Is there a way to do something like that?
If not how can I incorporate a check if I deleted my own rights then exit?
Or maybe a timer that check this rights in several minutes or something?
Solved! Go to Solution.
@Elitezone
I think the reason its still working on the next time the User opens an app is because Power Apps is being cached locally in the User's web browser. Caching is a great way to improve app load speeds but it can cause problems like the one you described.
You could bypass this a couple of different ways.
#1. Perform a check when the user enters the screen to see if they are still an Admin user. Do this in the OnVisible property of the screen.
#2. Perform a check every minute when the user is on a sensitive screen using a timer. I don't like this idea though because it would make way too many calls.
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
@Elitezone
I think the reason its still working on the next time the User opens an app is because Power Apps is being cached locally in the User's web browser. Caching is a great way to improve app load speeds but it can cause problems like the one you described.
You could bypass this a couple of different ways.
#1. Perform a check when the user enters the screen to see if they are still an Admin user. Do this in the OnVisible property of the screen.
#2. Perform a check every minute when the user is on a sensitive screen using a timer. I don't like this idea though because it would make way too many calls.
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Ok. I have added it on some screens, seems to be working sometimes... but not always...
Can it be done with IF statement?
Set(
varAdmin,
!IsBlank(
LookUp(
ListaAdmin,
'Dane administratora'.Email=gblUserEmail
)
)
For example - first this check it sets varAdmin.
If varAdmin is false then navigate to different screen or exit.
Seems to have made something like that:
showDialogAdmin=false;Set(
varAdmin,
!IsBlank(
LookUp(
ListaAdmin,
'Dane administratora'.Email=gblUserEmail
)));If(varAdmin=false,Navigate(Screen1;Fade))
But wish I could make it on change in gallery or form.
it spams a bit of errors mostly.
And the new one for me - navigate cannot be used in onVisible.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
207 | |
98 | |
60 | |
55 | |
52 |
User | Count |
---|---|
257 | |
160 | |
87 | |
79 | |
66 |