Search code examples
powerapps

PowerApps : Implementing Role Based Security In Your PowerApps App


I have created an app using Power Apps. Assume Home Screen has two buttons "admin" and "user". If a user with Admin roles accesses the app he/she should only be able to see "Admin" button. In case user with "User" role logs in, he/she should only be able to see "user" button. Assume users to be a part of Azure Active Directory.


Solution

  • Controlling access to app elements based on user security role, there are three approaches to this:

    Method 1: We can make use of Azure Active Directory Groups. We need to create a custom connector in PowerApps, that would return groups (denotes security role) that the user is a part of. These groups should be created in Azure Active Director. The user must belong to a group.

    Method 2: This is more applicable if data source for the app uses security role-based model. In this case PowerApps will inherit user’s security roles within data source.

    Method 3: Let’s assume to have SQL server database as the data source for our app. we can create our own security model for e.g. have a user table with columns storing Boolean type values (Bit in SQL Server), each column representing a security role. A value true denotes the user has the corresponding roles assigned.