cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
duncant
Helper V
Helper V

Restricting Functions and Access

Is there a way to restrict access to screens or functions (i.e. create or remove records from a data source) within an app?

I believe this can be easily done with an if statement within the visible property, but where can the groups or users be defined to ensure the restriction is enabled?

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @duncant ,

Do you want to limit the function of creating or removing data source?

There are two ways, let me explain them.

1)give different users different permission of your data source.

You should setting this in your data source.

 

2)use if statement when creating or removing data source to justify users.

You should set this in your app.

For example, set the navigate button's OnSelect:

If(User().Email="emailaddress1",Navigate(Screenupdate),
   Navigate(Screenread)
   )

You could only set the submit button's OnSelect:

If(User().Email="emailaddress1",Patch(...))  //please replace emailaddress1 with the emaill address that you want

//only current user's email="emailaddress1", then he could submit the data

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

KC
Kudo Kingpin
Kudo Kingpin

You can restrict access by determining if the user belongs to an Active Directory Security Group, SharePoint Group, or Office 365 Group.

 

This is from a post I wrote on implementing security using the Office 365 Groups connector. 

https://docs.microsoft.com/en-us/connectors/office365groups/

 

My Post: https://powerusers.microsoft.com/t5/News-Announcements-Formerly/Components-Part-2-Theme-Component-Ad...

In the Parent, App - OnStart property add the following after where we detect if we are connected or not:

// Detect if we are Online or Offline
...

ClearCollect(
    BrandingSecurityGroup,
    Office365Groups.ListGroupMembers("[GROUP OBJECT ID]").value
);
If(
    Office365Users.MyProfile().DisplayName in BrandingSecurityGroup.displayName,
    Set(
        SharePointAccess,
        true
    ),
    Set(
        SharePointAccess,
        false
    )
)

Hope this helps.

View solution in original post

4 REPLIES 4
v-yutliu-msft
Community Support
Community Support

Hi @duncant ,

Do you want to limit the function of creating or removing data source?

There are two ways, let me explain them.

1)give different users different permission of your data source.

You should setting this in your data source.

 

2)use if statement when creating or removing data source to justify users.

You should set this in your app.

For example, set the navigate button's OnSelect:

If(User().Email="emailaddress1",Navigate(Screenupdate),
   Navigate(Screenread)
   )

You could only set the submit button's OnSelect:

If(User().Email="emailaddress1",Patch(...))  //please replace emailaddress1 with the emaill address that you want

//only current user's email="emailaddress1", then he could submit the data

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

What if you want to limit access by group versus having to key in each email, how would you go about doing that?

KC
Kudo Kingpin
Kudo Kingpin

You can restrict access by determining if the user belongs to an Active Directory Security Group, SharePoint Group, or Office 365 Group.

 

This is from a post I wrote on implementing security using the Office 365 Groups connector. 

https://docs.microsoft.com/en-us/connectors/office365groups/

 

My Post: https://powerusers.microsoft.com/t5/News-Announcements-Formerly/Components-Part-2-Theme-Component-Ad...

In the Parent, App - OnStart property add the following after where we detect if we are connected or not:

// Detect if we are Online or Offline
...

ClearCollect(
    BrandingSecurityGroup,
    Office365Groups.ListGroupMembers("[GROUP OBJECT ID]").value
);
If(
    Office365Users.MyProfile().DisplayName in BrandingSecurityGroup.displayName,
    Set(
        SharePointAccess,
        true
    ),
    Set(
        SharePointAccess,
        false
    )
)

Hope this helps.

duncant
Helper V
Helper V

Lets say you are not using Common Data Services to restrict your data, but an excel spreadsheet instead.  What would you do then?

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (4,786)