cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Grahambo05
Level 8

Show Button or Screen based on User permissions

Is there a way to create an If statement for the Visibile property on a button to only display if the current user has Create item permission on the list?

 

Or

 

Is there a way to show a particular OnStart screen based on who the user is?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps Staff cherie
Power Apps Staff

Re: Show Button or Screen based on User permissions

You can use the onStart function or onvisible depending on your use case

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-screen

View solution in original post

13 REPLIES 13
Power Apps Staff cherie
Power Apps Staff

Re: Show Button or Screen based on User permissions

You can use the User function (https://powerapps.microsoft.com/en-us/tutorials/function-user/) or the office 365 connector (https://powerapps.microsoft.com/en-us/tutorials/connection-office365-outlook/) to find out who the user is and navigate to a particular screen based on the user.

 

I'm not sure about how to detect if the user has create list permissions however. @KeremY or @sarafankit who might know the answer.

Grahambo05
Level 8

Re: Show Button or Screen based on User permissions

@cherie

 

I have tried using DataSourceinfo.CreatePermission but that does not work. Other users have pointed out this issue.

 

What screen property would you set to enforce a specific startup screen?

Could this be used for a group of users?

Power Apps Staff cherie
Power Apps Staff

Re: Show Button or Screen based on User permissions

You can use the OnStart property. That will trigger the once when the app is run.

 

You can check if the user belongs to a table (eg. an admin table). Take a look at the Filter function (https://powerapps.microsoft.com/en-us/tutorials/function-filter-lookup/)

Alam
Level: Powered On

Re: Show Button or Screen based on User permissions

If you could add an example of pulling this info., it would be really great
Power Apps Staff cherie
Power Apps Staff

Re: Show Button or Screen based on User permissions

Which part would you need assistance with?

Alam
Level: Powered On

Re: Show Button or Screen based on User permissions

To hide/view specific buttons based on users in specific groups. Like users in my team cam view all buttons, and hide few for rest all users in org.
bishoy
Level: Powered On

Re: Show Button or Screen based on User permissions

Hi,

 

You can use the below

 

If(User().Email = "user@domain.com", DisplayMode.View)

Super User
Super User

Re: Show Button or Screen based on User permissions

Hi!

 

In this old post: https://powerusers.microsoft.com/t5/General-Discussion/Is-it-possible-to-switch-the-view-as-InfoPath... I talk about using membership in AD groups to control the visibility of UI elements.

 

Good luck!

bBI
Level: Power Up

Re: Show Button or Screen based on User permissions

> You can use the below

 

> If(User().Email = "user@domain.com", DisplayMode.View)

 

Where do we use this?

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (3,901)