Share via


Access Control Entries - Set Access Control Entries

在 ACL 中新增或更新所提供權杖的 ACL。 要求本文包含目標權杖、 ACE 清單和選擇性合併參數。 如果身分識別描述元) 與 ACL 中現有的 ACE 發生衝突 (,「merge」 參數會決定行為。 如果已設定,則現有的 ACE 允許和拒絕會與傳入 ACE 的允許和拒絕合併。 如果未設定,現有的 ACE 就會被取代。

POST https://dev.azure.com/{organization}/_apis/accesscontrolentries/{securityNamespaceId}?api-version=6.0

URI 參數

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

string

uuid

安全性命名空間識別碼。

organization
path

string

Azure DevOps 組織的名稱。

api-version
query True

string

要使用的 API 版本。 這應該設定為 '6.0' 以使用此版本的 API。

要求本文

名稱 類型 Description
item

string

type

string

取得這個 JToken 的節點類型。

回應

名稱 類型 Description
200 OK

AccessControlEntry[]

成功作業

安全性

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

名稱 Description
vso.security_manage 授與讀取、寫入和管理安全性許可權的能力。

範例

Merge
Replace

Merge

Sample Request

POST https://dev.azure.com/fabrikam/_apis/accesscontrolentries/5a27515b-ccd7-42c9-84f1-54c998f03866?api-version=6.0

{
  "token": "newToken",
  "merge": true,
  "accessControlEntries": [
    {
      "descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-2",
      "allow": 8,
      "deny": 0,
      "extendedinfo": {}
    }
  ]
}

Sample Response

{
  "count": 1,
  "value": [
    {
      "descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-2",
      "allow": 13,
      "deny": 0,
      "extendedInfo": {}
    }
  ]
}

Replace

Sample Request

POST https://dev.azure.com/fabrikam/_apis/accesscontrolentries/5a27515b-ccd7-42c9-84f1-54c998f03866?api-version=6.0

{
  "token": "newToken",
  "merge": false,
  "accessControlEntries": [
    {
      "descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-1",
      "allow": 8,
      "deny": 0,
      "extendedinfo": {}
    }
  ]
}

Sample Response

{
  "count": 1,
  "value": [
    {
      "descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1204400969-2402986413-2179408616-0-0-0-0-1",
      "allow": 8,
      "deny": 0,
      "extendedInfo": {}
    }
  ]
}

定義

名稱 Description
AccessControlEntry

用於封裝指定 IdentityDescriptor 之允許和拒絕許可權的類別。

AceExtendedInformation

保留指定 AccessControlEntry 的繼承有效許可權資訊。

IdentityDescriptor

身分識別描述元是 Windows SID、Passport) 身分識別 (類型的包裝函式,以及 SID 或 PUID 等唯一識別碼。

JObject

表示 JSON 物件。

AccessControlEntry

用於封裝指定 IdentityDescriptor 之允許和拒絕許可權的類別。

名稱 類型 Description
allow

integer

一組許可權位,表示允許執行相關聯描述元的動作。

deny

integer

一組許可權位,表示不允許執行相關聯描述元的動作。

descriptor

IdentityDescriptor

此 AccessControlEntry 適用于使用者的描述項。

extendedInfo

AceExtendedInformation

當設定時,這個值會報告相關聯描述項的繼承和有效資訊。 只有在 QueryAccessControlList 傳回的 AccessControlEntries 上設定這個值, (s) 呼叫其 includeExtendedInfo 參數設定為 true 時。

AceExtendedInformation

保留指定 AccessControlEntry 的繼承有效許可權資訊。

名稱 類型 Description
effectiveAllow

integer

這是此權杖上此身分識別的所有明確和繼承許可權的組合。 這些是判斷指定使用者是否有權執行動作時所使用的許可權。

effectiveDeny

integer

這是此權杖上此身分識別的所有明確和繼承許可權的組合。 這些是判斷指定使用者是否有權執行動作時所使用的許可權。

inheritedAllow

integer

這些是在此權杖上針對此身分識別繼承的許可權。 如果權杖未繼承許可權,這將會是 0。 請注意,此身分識別在此權杖上明確設定的任何許可權,或此身分識別所屬的任何群組,都不包含在此。

inheritedDeny

integer

這些是在此權杖上針對此身分識別繼承的許可權。 如果權杖未繼承許可權,這將會是 0。 請注意,此身分識別在此權杖上明確設定的任何許可權,或此身分識別所屬的任何群組,都不包含在此。

IdentityDescriptor

身分識別描述元是 Windows SID、Passport) 身分識別 (類型的包裝函式,以及 SID 或 PUID 等唯一識別碼。

名稱 類型 Description
identifier

string

此身分識別的唯一識別碼,不超過 256 個字元,將會保存。

identityType

string

描述項的類型 (例如 Windows、Passport 等) 。

JObject

表示 JSON 物件。

名稱 類型 Description
item

string

type

string

取得這個 JToken 的節點類型。