We are trying to change Button Visibility Based on User Role. Added Custom Security Role, Assigned roles to Users from Dynamics 365 environment .
Assigned These roles to Users via Manage Roles option.
How can we get Role assigned for CurrentUser in Powerapps Environment? Only 3 attributes(Email,fullName,Image) are available for User() object. Tried using Dynamics 365 Users, Security roles etc into Datasource. Also tried by adding Users entity into Datasource.
In a classic Dynamics CRM web UI or Model driven PowerApp, we have a choice to write client side form scripting to pull current user’s security roles and manipulate the client controls. We will be using web api or odata & utilize the
systemuserrolescollection
orSystemUserRolesSet
dataset to pull the needed data. Read moreBut in Canvas apps, even today we are unable to find this
System user roles
table in Dynamics 365 connectors. So we have to wait till this is exposed.Or you can have a SQL replication (maybe Data export service) or custom connector which consume the D365 web api to pull this data.