Groups - Add Group User

向指定用户授予对指定工作区的指定权限。

权限

此 API 调用可由服务主体配置文件调用。 有关详细信息,请参阅:Power BI Embedded中的服务主体配置文件。

所需范围

Workspace.ReadWrite.All

局限性

  • 工作区的用户权限需要一段时间才能更新,在使用 API 调用时可能不会立即可用。 若要刷新用户权限,请使用 刷新用户权限 API 调用。

POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/users

URI 参数

名称 必需 类型 说明
groupId
path True

string (uuid)

工作区 ID

请求正文

名称 必需 类型 说明
groupUserAccessRight True

GroupUserAccessRight

用户对工作区拥有的访问权限(权限级别)

identifier True

string

主体的标识符

principalType True

PrincipalType

主体类型

displayName

string

主体的显示名称

emailAddress

string

用户电子邮件地址

graphId

string

Microsoft Graph 中主体的标识符。 仅适用于管理员 API。

profile

ServicePrincipalProfile

Power BI 服务主体配置文件。 仅适用于 Power BI Embedded 多租户解决方案

userType

string

用户的类型。

响应

名称 类型 说明
200 OK

还行

示例

Assign administrator user access rights to a service principal example
Example

Assign administrator user access rights to a service principal example

示例请求

POST https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/users
{
  "identifier": "1f69e798-5852-4fdd-ab01-33bb14b6e934",
  "groupUserAccessRight": "Admin",
  "principalType": "App"
}

示例响应

Example

示例请求

POST https://api.powerbi.com/v1.0/myorg/groups/f089354e-8366-4e18-aea3-4cb4a3a50b48/users
{
  "emailAddress": "john@contoso.com",
  "groupUserAccessRight": "Admin"
}

示例响应

定义

名称 说明
GroupUser

有权访问工作区的 Power BI 用户

GroupUserAccessRight

用户对工作区拥有的访问权限(权限级别)

PrincipalType

主体类型

ServicePrincipalProfile

Power BI 服务主体配置文件。 仅适用于 Power BI Embedded 多租户解决方案

GroupUser

有权访问工作区的 Power BI 用户

名称 类型 说明
displayName

string

主体的显示名称

emailAddress

string

用户电子邮件地址

graphId

string

Microsoft Graph 中主体的标识符。 仅适用于管理员 API。

groupUserAccessRight

GroupUserAccessRight

用户对工作区拥有的访问权限(权限级别)

identifier

string

主体的标识符

principalType

PrincipalType

主体类型

profile

ServicePrincipalProfile

Power BI 服务主体配置文件。 仅适用于 Power BI Embedded 多租户解决方案

userType

string

用户的类型。

GroupUserAccessRight

用户对工作区拥有的访问权限(权限级别)

说明
Admin

工作区内容的管理员权限

Contributor

读取和浏览对工作区内容的访问

Member

读取、重新共享和浏览 (ReadReshareExplore) 对工作区内容的访问权限

None

无法访问工作区内容

Viewer

对工作区内容的只读(读取)访问权限

PrincipalType

主体类型

说明
App

服务主体类型

Group

组主体类型

None

无主体类型。 用于整个组织级别的访问。

User

用户主体类型

ServicePrincipalProfile

Power BI 服务主体配置文件。 仅适用于 Power BI Embedded 多租户解决方案

名称 类型 说明
displayName

string

服务主体配置文件名称

id

string (uuid)

服务主体配置文件 ID