REST Resource: roleAssignments

資源:RoleAssignment

定義角色指派作業。

JSON 表示法
{
  "roleAssignmentId": string,
  "roleId": string,
  "kind": string,
  "etag": string,
  "assignedTo": string,
  "assigneeType": enum (AssigneeType),
  "scopeType": string,
  "orgUnitId": string,
  "condition": string
}
欄位
roleAssignmentId

string (int64 format)

這個角色指派作業的 ID。

roleId

string (int64 format)

指派的角色 ID。

kind

string

API 資源的類型。一律為 admin#directory#roleAssignment

etag

string

資源的 ETag。

assignedTo

string

指派此角色的實體專屬 ID,可以是使用者的 userId、群組的 groupId,或服務帳戶 (如 Identity and Access Management (IAM)) 定義的 uniqueId

assigneeType

enum (AssigneeType)

僅供輸出。指派對象的類型 (USERGROUP)。

scopeType

string

指派這個角色的範圍。

可接受的值為:

  • CUSTOMER
  • ORG_UNIT
orgUnitId

string

如果角色僅限特定機構單位,當中會包含執行這個角色的機構單位 ID。

condition

string

選用設定。(公開測試版 - 可在 /admin/directory/v1.1beta1 的 API 版本中使用)

注意:這項功能適用於 Enterprise Standard、Enterprise Plus、Google Workspace for Education Plus 和 Cloud Identity 進階版客戶。您無須進行額外設定即可使用這項功能。目前在 Beta 版中,管理控制台 (http://admin.google.com) 尚未套用與 condition 相關聯的 RoleAssignment

與這個角色指派作業相關聯的條件。設有 condition 欄位設定的 RoleAssignment 只有在存取的資源符合條件時才會生效。如果 condition 為空白,系統會無條件為範圍 (scopeType) 的執行者 (assignedTo) 套用角色 (roleId)。

目前只支援兩個條件:

  • 如要讓「RoleAssignment」僅適用於「安全性群組」api.getAttribute('cloudidentity.googleapis.com/groups.labels', []).hasAny(['groups.security']) && resource.type == 'cloudidentity.googleapis.com/Group'

  • 如何讓「RoleAssignment」不適用於安全性群組!api.getAttribute('cloudidentity.googleapis.com/groups.labels', []).hasAny(['groups.security']) && resource.type == 'cloudidentity.googleapis.com/Group'

目前這兩種條件字串必須逐字輸入,且僅適用於以下預先建立的管理員角色

  • 群組編輯者
  • 群組讀取者

條件符合 Cloud IAM 條件語法

AssigneeType

獲派角色的身分類型。

列舉
USER 網域中的個別使用者。
GROUP 網域中的群組。

方法

delete

刪除角色指派作業。

get

擷取角色指派作業。

insert

建立角色指派作業。

list

擷取所有 roleAssignments 的分頁清單。