共用方式為


Gateways - Add Datasource User

授與或更新為指定使用者使用指定數據源所需的許可權。

權限

用戶必須具有閘道管理員許可權。

必要範圍

Dataset.ReadWrite.All

局限性

不支援虛擬網路 (VNet) 閘道。 不支援透過 API 新增群組。

POST https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}/users

URI 參數

名稱 位於 必要 類型 Description
datasourceId
path True

string (uuid)

數據源標識碼

gatewayId
path True

string (uuid)

閘道識別碼。 使用閘道叢集時,閘道標識碼是指叢集中的主要 (第一個) 網關。 在這種情況下,閘道標識碼類似於閘道叢集標識碼。

要求本文

名稱 必要 類型 Description
datasourceAccessRight True

DatasourceUserAccessRight

使用者對資料來源具有的存取權限(權限等級)

displayName

string

主體的顯示名稱

emailAddress

string

用戶的電子郵件位址

identifier

string

主體的 對象標識碼

principalType

PrincipalType

主體類型

profile

ServicePrincipalProfile

Power BI 服務主體配置檔。 僅與 Power BI Embedded 多租使用者解決方案相關。

回應

名稱 類型 Description
200 OK

還行

範例

Assign the ReadOverrideEffectiveIdentity user access right to a service principal example
Example

Assign the ReadOverrideEffectiveIdentity user access right to a service principal example

範例要求

POST https://api.powerbi.com/v1.0/myorg/gateways/1f69e798-5852-4fdd-ab01-33bb14b6e934/datasources/252b9de8-d915-4788-aaeb-ec8c2395f970/users
{
  "identifier": "3d9b93c6-7b6d-4801-a491-1738910904fd",
  "datasourceAccessRight": "ReadOverrideEffectiveIdentity"
}

範例回覆

Example

範例要求

POST https://api.powerbi.com/v1.0/myorg/gateways/1f69e798-5852-4fdd-ab01-33bb14b6e934/datasources/252b9de8-d915-4788-aaeb-ec8c2395f970/users
{
  "emailAddress": "john@contoso.com",
  "datasourceAccessRight": "Read"
}

範例回覆

定義

名稱 Description
DatasourceUser

可存取數據源的Power BI 使用者

DatasourceUserAccessRight

使用者對資料來源具有的存取權限(權限等級)

PrincipalType

主體類型

ServicePrincipalProfile

Power BI 服務主體配置檔。 僅與 Power BI Embedded 多租使用者解決方案相關。

DatasourceUser

可存取數據源的Power BI 使用者

名稱 類型 Description
datasourceAccessRight

DatasourceUserAccessRight

使用者對資料來源具有的存取權限(權限等級)

displayName

string

主體的顯示名稱

emailAddress

string

用戶的電子郵件位址

identifier

string

主體的 對象標識碼

principalType

PrincipalType

主體類型

profile

ServicePrincipalProfile

Power BI 服務主體配置檔。 僅與 Power BI Embedded 多租使用者解決方案相關。

DatasourceUserAccessRight

使用者對資料來源具有的存取權限(權限等級)

Description
None

沒有存取數據源的許可權。 只有在更新用戶權力時才會套用。

Read

用戶所擁有的數據集具有數據源的讀取許可權

ReadOverrideEffectiveIdentity

用戶可以覆寫 Power BI Embedded 的有效身分識別。 僅適用於內部部署 Analysis Services 數據源。

PrincipalType

主體類型

Description
App

服務主體類型

Group

群組主體類型

None

沒有主體類型。 用於整個組織層級存取。

User

用戶主體類型

ServicePrincipalProfile

Power BI 服務主體配置檔。 僅與 Power BI Embedded 多租使用者解決方案相關。

名稱 類型 Description
displayName

string

服務主體配置檔名稱

id

string (uuid)

服務主體配置檔識別碼