Groups - Add Group User

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

用户对工作区的权限最近更新后,新权限可能无法通过 API 调用立即可用。 若要刷新用户权限,请使用 刷新用户权限 API 调用。

权限

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

必需范围

Workspace.ReadWrite.All

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

URI 参数

Name In Required Type Description
groupId
path True
  • string
uuid

工作区 ID

请求正文

Name Required Type Description
groupUserAccessRight True

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

identifier True
  • string

主体的标识符

principalType True

主体类型

displayName
  • string

主体的显示名称

emailAddress
  • string

用户的电子邮件地址

graphId
  • string

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

profile

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

userType
  • string

用户的类型。

响应

Name Type Description
200 OK

确定

示例

Assign administrator user access rights to a service principal example
Example

Assign administrator user access rights to a service principal example

Sample Request

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"
}

Sample Response

Example

Sample Request

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

Sample Response

定义

GroupUser

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

GroupUserAccessRight

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

PrincipalType

主体类型

ServicePrincipalProfile

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

GroupUser

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

Name Type Description
displayName
  • string

主体的显示名称

emailAddress
  • string

用户的电子邮件地址

graphId
  • string

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

groupUserAccessRight

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

identifier
  • string

主体的标识符

principalType

主体类型

profile

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

userType
  • string

用户的类型。

GroupUserAccessRight

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

Name Type Description
Admin
  • string

工作区内容的管理员权限

Contributor
  • string

读取和浏览 (ReadExplore) 工作区内容的访问权限

Member
  • string

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

None
  • string

无法访问工作区内容

Viewer
  • string

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

PrincipalType

主体类型

Name Type Description
App
  • string

服务主体类型

Group
  • string

组主体类型

None
  • string

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

User
  • string

用户主体类型

ServicePrincipalProfile

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

Name Type Description
displayName
  • string

服务主体配置文件名称

id
  • string

服务主体配置文件 ID