如何从 Powerapps 获取为 Office 365 环境中的用户分配的角色 [英] How to get roles assigned for an user in Office 365 environment from Powerapps

查看:132
本文介绍了如何从 Powerapps 获取为 Office 365 环境中的用户分配的角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试根据用户角色更改按钮可见性.添加了自定义安全角色,为 Dynamics 365 环境中的用户分配角色.

自定义安全角色

通过管理角色"选项将这些角色分配给用户.

管理用户角色

我们如何在 Powerapps 环境中为 CurrentUser 分配角色?User() 对象只有 3 个属性(Email、fullName、Image)可用.尝试在数据源中使用 Dynamics 365 用户、安全角色等.还尝试将用户实体添加到数据源中.

Dynamics 365 安全角色,用户进入数据源

解决方案

在经典的 Dynamics CRM Web UI 或模型驱动的 PowerApp 中,我们可以选择编写客户端表单脚本来提取当前用户的安全角色并操作客户端控件.我们将使用 web api 或 odata &利用 systemuserrolescollectionSystemUserRolesSet 数据集来提取所需的数据.阅读更多

但在 Canvas 应用程序中,即使在今天,我们也无法在 Dynamics 365 连接器中找到此 系统用户角色 表.所以我们必须等到这件事曝光.

或者您可以使用使用 D365 web api 以提取此数据.

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

解决方案

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.

这篇关于如何从 Powerapps 获取为 Office 365 环境中的用户分配的角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆