From 949a5128f5a2818ffc27587dc026ebe1059fcbb6 Mon Sep 17 00:00:00 2001 From: Jeremy Tymes <jeremy@jtymes.net> Date: Mon, 7 Mar 2022 01:28:46 +0000 Subject: [PATCH 1/2] Expose membership_lock on group detail API Changelog: changed EE: true --- doc/api/groups.md | 14 ++++++++++++++ ee/lib/ee/api/entities/group_detail.rb | 2 ++ 2 files changed, 16 insertions(+) diff --git a/doc/api/groups.md b/doc/api/groups.md index 120090c18a265df9..59845753d0e6e9b3 100644 --- a/doc/api/groups.md +++ b/doc/api/groups.md @@ -483,6 +483,8 @@ Example response: ## Details of a group +> The `membership_lock` field was [added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82271) in GitLab 14.9. + Get all details of a group. This endpoint can be accessed without authentication if the group is publicly accessible. In case the user that requests is an administrator if the group is publicly accessible. With authentication, it returns the `runners_token` @@ -715,6 +717,18 @@ the `marked_for_deletion_on` attribute: } ``` +Users of [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see +the `membership_lock` attribute: + +```json +{ + "id": 4, + "description": "Aliquid qui quis dignissimos distinctio ut commodi voluptas est.", + "membership_lock": false, + ... +} +``` + When adding the parameter `with_projects=false`, projects aren't returned. ```shell diff --git a/ee/lib/ee/api/entities/group_detail.rb b/ee/lib/ee/api/entities/group_detail.rb index 1c54be9ee1d8f779..b7e36f9a6b110c15 100644 --- a/ee/lib/ee/api/entities/group_detail.rb +++ b/ee/lib/ee/api/entities/group_detail.rb @@ -11,6 +11,8 @@ module GroupDetail expose :extra_shared_runners_minutes_limit expose :prevent_forking_outside_group?, as: :prevent_forking_outside_group + expose :membership_lock?, + as: :membership_lock end end end -- GitLab From 79174d495f3b68b2fc89c9b053a32c6adcf12408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Wawrzyniak?= <mwawrzyniak@gitlab.com> Date: Wed, 23 Mar 2022 09:52:20 +0000 Subject: [PATCH 2/2] Apply 1 suggestion(s) to 1 file(s) --- doc/api/groups.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/groups.md b/doc/api/groups.md index 59845753d0e6e9b3..a4aa2330c291e136 100644 --- a/doc/api/groups.md +++ b/doc/api/groups.md @@ -483,7 +483,7 @@ Example response: ## Details of a group -> The `membership_lock` field was [added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82271) in GitLab 14.9. +> The `membership_lock` field was [added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82271) in GitLab 14.10. Get all details of a group. This endpoint can be accessed without authentication if the group is publicly accessible. In case the user that requests is an administrator -- GitLab