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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to get the Securit...
Power Apps
Unanswered

How to get the Security Roles with Permission levels to PowerApps screen using CDS?

(0) ShareShare
ReportReport
Posted on by 2

Hello All,

 

I have a requirement to hide and show the Save button in powerapps screen based on the current user permissions which are stored in CDS Security roles. I am able to get the all groups (Security Roles) to Powerapps screen but could not able to get Permission levels of user and Particular group where current user exists. Can anyone help how to achieve this.

Thanks in advance if anyone could help !!!

I have the same question (0)
  • David Jennaway Profile Picture
    716 on at

    Is this a canvas app or a model-driven app ? If it's a model-driven app, you can define a DisplayRule with an EntityPrivilegeRule and associate it with a ribbon button; this will only display the button if the user has the appropriate privilege(s).

     

    If it's a canvas app you can use the systemuserroles_association entity (strictly it's an N:N relationship) to get the roles associated with users, and filter this by the current user id. Alternatively, you could create a dummy entity in CDS, and apply permissions such that only the users in roles who should be able to see the Save button would be able to view a record in this dummy entity, and test to see if the user can get any results

  • bhushan235 Profile Picture
    2 on at

    Hi David,

     

    This is Canvas app and I have below formulae on items.

    bhushan235_0-1596795135211.png

    Here if apply 'Security Roles' then I can see all list and when i have added 'systemuserroles_association' then its not taking.

     

    Thanks,

    Bhushan

  • Ben Thompson Profile Picture
    1,400 on at

    That query will only give you security role details (i.e. the role name and similar items), it won't give you the modular level of access I think you want and getting to that level would be beyond painful.

     

    My advice would be to create a security role(s) for this functionality and give the users who need this functionality the appropriate security role(s)

  • Julien Groud Profile Picture
    on at

    @bhushan235 

    Please take a look at the accepted solution of the thread below. It should help you out!

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Get-user-security-role/td-p/448866

     

    Julien

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard