How to get roles assigned for an user in Office 365 environment from Powerapps

旧巷老猫 提交于 2019-12-13 05:49:33

问题


We are trying to change Button Visibility Based on User Role. Added Custom Security Role, Assigned roles to Users from Dynamics 365 environment .

Custom Security roles

Assigned These roles to Users via Manage Roles option.

Manage User Roles

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.

Dynamics 365 security roles, users in to datasource


回答1:


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 or SystemUserRolesSet dataset to pull the needed data. Read more

But 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.



来源:https://stackoverflow.com/questions/53262784/how-to-get-roles-assigned-for-an-user-in-office-365-environment-from-powerapps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!