web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dataverse Security Rol...
Power Apps
Answered

Dataverse Security Roles with Canvas App Advice

(0) ShareShare
ReportReport
Posted on by 44

Hello all,

 

I am attempting to build by first canvas app with dataverse as the primary data source.

 

Something I am not too confident with is how to integrate security roles within the app (I'm also not sure if this is the way to go about my problem).

 

Essentially I would like to hide buttons/stop access to specific tables, based on the current user.

 

Is setting up a security role the way to go for this? How do I actually reference the security roles within my app? I have connected the Security Roles connector but not sure how it works. Could anyone provide a sample code?

 

Thank you in advanced.

I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @DB2NV ,

     

    You don't have to use a security role table in your app.

    When a security role is assigned to a user, the user has the permissions configured in the security role.

    In other words, if the security role does not have permission to access the table data and you assign the security role to the user, the user will not be able to see any data after opening the app.

     

    If you want to hide the button when the user cannot see any data, please set the visible attribute of the button to

    If(CountRows(tablename)=0,false,true)

     

    Best Regards,

    Wearsky

  • DB2NV Profile Picture
    44 on at

    Hi @v-xiaochen-msft,

     

    Thanks for your reply.

     

    In relation to hiding a button, I should have clarified. What I mean is that if I have a user who is an Admin, I would like certain functions or buttons to be made available (which wouldn't otherwise be for other users) for example. Can/should this be related to a security role?

     

    Thank you

     

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @DB2NV ,

     

    If you don't have a lot of admins, you can hardcode your formula.

    Sample:

    Visbible property
    If(User().Email in ["***","***", ...],true,false)

     

    If they are dynamic, the method you mentioned will work.

     

    Best Regards,

    Wearsky

  • DB2NV Profile Picture
    44 on at

    Is that considered common practice in app building?

  • Verified answer
    powerx365 Profile Picture
    42 on at

     

    @DB2NV - Hardcoding emails is not a common practice, nor is it recommended. To check the permissions for a user, for example for the Read access for Account table, you can use the following formula: 

    DataSourceInfo(Accounts, DataSourceInfo.ReadPermission)

     

    Here's a good guide on how to implement this: https://lowcodelewis.com/blog/check-and-display-dataverse-permissions-to-users-in-power-apps

     

    That being said, if you are already using Dataverse, why not opt for Model Driven Apps? The entire value proposition for Model Driven Apps is that you won't have to build all these formulas and such logic is out of the box. Just some food for thought 🙂

     

     

    Px - Logo.png

    Rajat Joshi

    Power x 365

    Experience the Difference

  • DB2NV Profile Picture
    44 on at

    A model driven app was my original intention, but I feel like you're stuck in a box when using it. There is limited combustibility and my preference is to use formulas to drive my needs.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 430

#2
timl Profile Picture

timl 318 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard