How to check user permission/ privilege on a record/ table in Power Apps Canvas app

If you are in this blog, I am sure the title of the blog must have got you pretty excited by now. Well the topic is interesting indeed but as of the time of writing this blog, this apply only to DataVerse data source. I am pretty sure, Microsoft shall extend this support to other data sources.

Back to the requirement. Many a times in our project, we need to check what permission the user have on a record in a table. For example – If there is an customer record in DataVerse, do the logged in user have permissions to delete/ edit/ view the customer record. Or in fact the customer table itself.

And based on that, you may need to show/ hide controls on the screen.

Power Apps have couple of functions – RecordInfo and DataSourceInfo to help you do that. So let’s explore together.

In the below example, I am displaying the list of accounts in the Gallery. And inside that I am using a label to display if the user have edit permission for each of the records in Gallery.

Similarly you have permissions for RecordInfo.DeletePermission and RecordInfo.ReadPermission.

While this help you to know the user permissions on a record, there is another function DataSourceInfo which you can use to retrieve user permission on a table. For example – the below code can determine if the user have permission on the accounts table.

DataSourceInfo(Accounts, DataSourceInfo.ReadPermission)

Hope this helped!

You will also like the below posts

Debajit Dutta
Business Solutions MVP


Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe to get the latest posts sent to your email.

Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading