【问题标题】:Permission for user to do team level configuration without being able to alter team membership允许用户进行团队级别配置而不能更改团队成员身份
【发布时间】:2021-03-30 10:22:46
【问题描述】:

我们在 Azure DevOps 服务中有一个连接到 Azure AD 的组织。在 AAD 中有代表企业中每个团队的组。目标是将这些现有 AAD 组连接到 Azure DevOps 中的团队(即将这些组添加为团队成员),从而在 AAD 中专门管理成员资格。

这意味着任何人都不能更改团队成员(应该保留给项目管理员及以上人员)。

但是,当某人成为团队管理员时,他们会自动获得更改团队成员资格的权限,并且非团队管理员的人无法编辑团队设置,例如添加迭代或自定义看板(看板中的齿轮)。 我如何分离这些权限,即允许用户进行团队级别的配置,而不允许管理团队成员?

即使无法在 GUI 中执行ACL's are set directly through the rest api 感兴趣的解决方案。我在Security Namespaces 中进行了一些挖掘,并通过设置团队中用户的Identity 命名空间的ManageMembership 位使该用户成为团队的管理员(在GUI 中可见)。用户可以进行团队级别的自定义并(正如权限位的名称所暗示的)更新团队的成员资格。 如果没有授予管理团队成员的权限,我找不到允许团队级别自定义的权限。

到目前为止我所尝试的

不是团队管理员会产生消息

您没有足够的权限为此配置卡片 团队。您必须是团队管理员项目 管理员

通过 GUI 或通过在团队上设置 Manage Membership 位将用户添加为团队管理员会删除消息,但也会授予添加和删除成员的权限,这是我不想要的

# Input Parameters
$ado_org="TestOragnization"                                     ## Azure devops Organization
$ado_pat="****************************************************" ## Azure devops PAT Token
$projectName = "TestProject"                                    ## Azure devops Project Name
$teamName = "TestTeam"                                          ## Azure devops Team Name (must exist in Project)
$userName = "test@example.com"                                  ## Azure devops user (must exist in organization)

# Construct PAT authentication header
# https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f "user",$ado_pat)))
$headers = @{"Authorization" = ("Basic {0}" -f $base64AuthInfo)
}

# Get Project (https://docs.microsoft.com/en-us/rest/api/azure/devops/core/projects/get?)
$project = Invoke-RestMethod -Headers $headers `
  -Uri ("https://dev.azure.com/{0}/_apis/projects/{1}?api-version=6.0" -f $ado_org, $projectName) `

# Get Team (https://docs.microsoft.com/en-us/rest/api/azure/devops/core/teams/create)
$team = Invoke-RestMethod -Headers $headers `
  -Uri ("https://dev.azure.com/{0}/_apis/projects/{1}/teams/{2}?api-version=6.0" `
    -f $ado_org, $projectName, $teamName) `

# Get User (https://docs.microsoft.com/en-us/rest/api/azure/devops/ims/identities/read%20identities)
$user = Invoke-RestMethod -Headers $headers -Method GET -ContentType "application/json" `
  -Uri ("https://vssps.dev.azure.com/{0}/_apis/identities?searchFilter=General&filterValue={1}&api-version=6.0" `
    -f $ado_org, $userName)

# Construct ACL request
$token = "{0}\{1}" -f $project.id, $team.id
$namespace = "5a27515b-ccd7-42c9-84f1-54c998f03866" # Identity namespace
$allowbits = 8 # Manage Membership bit

$body = @{
  "token" = $token;
  "merge" = $false;
  "accessControlEntries" = @(
    @{
      "descriptor" = $user.value.descriptor
      "allow" = $allowbits;
      "deny" = 0;
      "extendedinfo" = @{};
    };
  )
}

# Set ACL
# https://docs.microsoft.com/en-us/rest/api/azure/devops/security/access%20control%20entries
Invoke-RestMethod -Headers $headers -Method POST -ContentType "application/json" `
  -Uri ("https://dev.azure.com/{0}/_apis/accesscontrolentries/{1}?api-version=6.0" -f $ado_org, $namespace) `
  -Body $(ConvertTo-Json -InputObject $body -depth 10)

【问题讨论】:

    标签: azure-devops azure-devops-rest-api azure-boards


    【解决方案1】:

    正如the document 所提到的,

    要配置团队设置,您必须添加到团队管理员角色或成为项目管理员安全组的成员。

    我们没有其他方法可以单独授予用户配置团队设置的权限。

    同样,要将用户添加到团队,您必须是团队管理员项目管理员。我们也没有其他方法可以单独授予用户此权限。详情请见“Add users to a project or team”。

    因此,一旦将用户添加为团队管理员项目管理员的成员,他就可以将用户添加到团队并配置团队设置。我们无法将这些权限与管理员用户分开。

    【讨论】:

    • 好的,所以他们没有单独的权限位来设置授予执行团队配置和看板配置的权限?都和Manage Membership权限绑定,不能分开?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-06
    • 2014-07-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-09
    相关资源
    最近更新 更多