<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Group and project members API > 原文:[https://docs.gitlab.com/ee/api/members.html](https://docs.gitlab.com/ee/api/members.html) * [Valid access levels](#valid-access-levels) * [List all members of a group or project](#list-all-members-of-a-group-or-project) * [List all members of a group or project including inherited members](#list-all-members-of-a-group-or-project-including-inherited-members) * [Get a member of a group or project](#get-a-member-of-a-group-or-project) * [Get a member of a group or project, including inherited members](#get-a-member-of-a-group-or-project-including-inherited-members) * [Add a member to a group or project](#add-a-member-to-a-group-or-project) * [Edit a member of a group or project](#edit-a-member-of-a-group-or-project) * [Set override flag for a member of a group](#set-override-flag-for-a-member-of-a-group) * [Remove override for a member of a group](#remove-override-for-a-member-of-a-group) * [Remove a member from a group or project](#remove-a-member-from-a-group-or-project) * [Give a group access to a project](#give-a-group-access-to-a-project) # Group and project members API[](#group-and-project-members-api "Permalink") ## Valid access levels[](#valid-access-levels "Permalink") 訪問級別在`Gitlab::Access`模塊中定義. 當前,這些級別被認可: * 無法訪問( `0` ) * 賓客( `10` ) * 記者( `20` ) * 顯影劑( `30` ) * 養護者( `40` ) * 所有者( `50` )-僅對組有效 **注意:**由于[存在問題](https://gitlab.com/gitlab-org/gitlab/-/issues/219299) ,個人名稱空間中的項目將不會顯示所有者( `50` )所有者的權限. ## List all members of a group or project[](#list-all-members-of-a-group-or-project "Permalink") 獲取可通過身份驗證的用戶查看的組或項目成員的列表. 僅返回直接成員,而不返回通過祖先組繼承的成員. 此函數使用分頁參數`page`和`per_page`來限制用戶列表. ``` GET /groups/:id/members GET /projects/:id/members ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目或組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `query` | string | no | 查詢字符串以搜索成員 | | `user_ids` | 整數數組 | no | 根據給定的用戶 ID 過濾結果 | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/members" curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/members" ``` 響應示例: ``` [ { "id": 1, "username": "raymond_smith", "name": "Raymond Smith", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "expires_at": "2012-10-22T14:13:35Z", "access_level": 30, "group_saml_identity": null }, { "id": 2, "username": "john_doe", "name": "John Doe", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "expires_at": "2012-10-22T14:13:35Z", "access_level": 30, "email": "john@example.com", "group_saml_identity": { "extern_uid":"ABC-1234567890", "provider": "group_saml", "saml_provider_id": 10 } } ] ``` ## List all members of a group or project including inherited members[](#list-all-members-of-a-group-or-project-including-inherited-members "Permalink") 獲取可通過身份驗證的用戶查看的組或項目成員的列表,包括通過祖先組繼承的成員. 當用戶是項目/組和一個或多個祖先組的成員時,僅以項目`access_level` (如果存在)或用戶所屬項目組中第一個組的用戶的`access_level`返回一次祖先鏈. 此函數使用分頁參數`page`和`per_page`來限制用戶列表. ``` GET /groups/:id/members/all GET /projects/:id/members/all ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目或組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `query` | string | no | 查詢字符串以搜索成員 | | `user_ids` | 整數數組 | no | 根據給定的用戶 ID 過濾結果 | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/members/all" curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/members/all" ``` 響應示例: ``` [ { "id": 1, "username": "raymond_smith", "name": "Raymond Smith", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "expires_at": "2012-10-22T14:13:35Z", "access_level": 30, "group_saml_identity": null }, { "id": 2, "username": "john_doe", "name": "John Doe", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "expires_at": "2012-10-22T14:13:35Z", "access_level": 30 "email": "john@example.com", "group_saml_identity": { "extern_uid":"ABC-1234567890", "provider": "group_saml", "saml_provider_id": 10 } }, { "id": 3, "username": "foo_bar", "name": "Foo bar", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "expires_at": "2012-11-22T14:13:35Z", "access_level": 30, "group_saml_identity": null } ] ``` ## Get a member of a group or project[](#get-a-member-of-a-group-or-project "Permalink") 獲取組或項目的成員. 僅返回直接成員,而不返回通過祖先組繼承的成員. ``` GET /groups/:id/members/:user_id GET /projects/:id/members/:user_id ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目或組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `user_id` | integer | yes | 成員的用戶標識 | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/members/:user_id" curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/members/:user_id" ``` 響應示例: ``` { "id": 1, "username": "raymond_smith", "name": "Raymond Smith", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "access_level": 30, "expires_at": null, "group_saml_identity": null } ``` ## Get a member of a group or project, including inherited members[](#get-a-member-of-a-group-or-project-including-inherited-members "Permalink") 在 GitLab 12.4 中[引入](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/17744) . 獲取組或項目的成員,包括通過祖先組繼承的成員. 有關詳細信息,請參見相應的[端點以列出所有繼承的成員](#list-all-members-of-a-group-or-project-including-inherited-members) . ``` GET /groups/:id/members/all/:user_id GET /projects/:id/members/all/:user_id ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目或組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `user_id` | integer | yes | 成員的用戶標識 | ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/members/all/:user_id" curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/members/all/:user_id" ``` 響應示例: ``` { "id": 1, "username": "raymond_smith", "name": "Raymond Smith", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "access_level": 30, "expires_at": null, "group_saml_identity": null } ``` ## Add a member to a group or project[](#add-a-member-to-a-group-or-project "Permalink") 將成員添加到組或項目. ``` POST /groups/:id/members POST /projects/:id/members ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目或組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `user_id` | integer | yes | 新成員的用戶標識 | | `access_level` | integer | yes | 有效的訪問級別 | | `expires_at` | string | no | 日期格式為 YEAR-MONTH-DAY 的日期字符串 | ``` curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "user_id=1&access_level=30" "https://gitlab.example.com/api/v4/groups/:id/members" curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --data "user_id=1&access_level=30" "https://gitlab.example.com/api/v4/projects/:id/members" ``` 響應示例: ``` { "id": 1, "username": "raymond_smith", "name": "Raymond Smith", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "expires_at": "2012-10-22T14:13:35Z", "access_level": 30, "group_saml_identity": null } ``` ## Edit a member of a group or project[](#edit-a-member-of-a-group-or-project "Permalink") 更新組或項目的成員. ``` PUT /groups/:id/members/:user_id PUT /projects/:id/members/:user_id ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目或組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `user_id` | integer | yes | 成員的用戶標識 | | `access_level` | integer | yes | 有效的訪問級別 | | `expires_at` | string | no | 日期格式為 YEAR-MONTH-DAY 的日期字符串 | ``` curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/members/:user_id?access_level=40" curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/members/:user_id?access_level=40" ``` 響應示例: ``` { "id": 1, "username": "raymond_smith", "name": "Raymond Smith", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "expires_at": "2012-10-22T14:13:35Z", "access_level": 40, "group_saml_identity": null } ``` ### Set override flag for a member of a group[](#set-override-flag-for-a-member-of-a-group "Permalink") 在 GitLab 13.0 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/4875) . 默認情況下,LDAP 組成員的訪問級別設置為 LDAP 通過組同步指定的值. 您可以通過調用此端點來允許訪問級別替代. ``` POST /groups/:id/members/:user_id/override ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 認證用戶擁有[的組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `user_id` | integer | yes | 成員的用戶標識 | ``` curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/groups/:id/members/:user_id/override" ``` 響應示例: ``` { "id": 1, "username": "raymond_smith", "name": "Raymond Smith", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "expires_at": "2012-10-22T14:13:35Z", "access_level": 40, "override": true } ``` ### Remove override for a member of a group[](#remove-override-for-a-member-of-a-group "Permalink") 在 GitLab 13.0 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/4875) . 將替代標志設置為 false,并允許 LDAP 組同步將訪問級別重置為 LDAP 指定的值. ``` DELETE /groups/:id/members/:user_id/override ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 認證用戶擁有[的組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `user_id` | integer | yes | 成員的用戶標識 | ``` curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/groups/:id/members/:user_id/override" ``` 響應示例: ``` { "id": 1, "username": "raymond_smith", "name": "Raymond Smith", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/c2525a7f58ae3776070e44c106c48e15?s=80&d=identicon", "web_url": "http://192.168.1.8:3000/root", "expires_at": "2012-10-22T14:13:35Z", "access_level": 40, "override": false } ``` ## Remove a member from a group or project[](#remove-a-member-from-a-group-or-project "Permalink") 從組或項目中刪除用戶. ``` DELETE /groups/:id/members/:user_id DELETE /projects/:id/members/:user_id ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer/string | yes | 經過身份驗證的用戶擁有[的項目或組](README.html#namespaced-path-encoding)的 ID 或[URL 編碼路徑](README.html#namespaced-path-encoding) | | `user_id` | integer | yes | 成員的用戶標識 | | `unassign_issuables` | boolean | false | 標志,指示是否應從給定的組或項目內取消分配任何問題或合并請求的已刪除成員 | ``` curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/members/:user_id" curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/members/:user_id" ``` ## Give a group access to a project[](#give-a-group-access-to-a-project "Permalink") See [share project with group](projects.html#share-project-with-group)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看