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

(Beta 版 - API 的 /admin/directory/v1.1beta1 版本提供)

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

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

目前僅支援兩個條件:

  • 如何將 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 條件語法

指派對象類型

您指派角色的身分類型。

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

方法

delete

刪除角色指派設定。

get

擷取角色指派作業。

insert

建立角色指派。

list

擷取所有角色指派作業的分頁清單。