Commit 736971d6 authored by Mathieu Parent's avatar Mathieu Parent

Fix visibility level error when updating group from API

'visibility_level' private is not allowed since this group contains projects with higher visibility

Fixes: #23083

Related: gitlab-foss#46746
parent a96e25ab
......@@ -9,6 +9,7 @@ module Groups
def execute
remove_unallowed_params
set_visibility_level
@group = Group.new(params)
......@@ -68,6 +69,12 @@ module Groups
true
end
def set_visibility_level
return if visibility_level.present?
params[:visibility_level] = Gitlab::CurrentSettings.current_application_settings.default_group_visibility
end
end
end
......
---
title: Fix visibility level error when updating group from API
merge_request: 17227
author: Mathieu Parent
type: fixed
......@@ -10,8 +10,6 @@ module API
optional :description, type: String, desc: 'The description of the group'
optional :visibility, type: String,
values: Gitlab::VisibilityLevel.string_values,
default: Gitlab::VisibilityLevel.string_level(
Gitlab::CurrentSettings.current_application_settings.default_group_visibility),
desc: 'The visibility of the group'
optional :lfs_enabled, type: Boolean, desc: 'Enable/disable LFS for the projects in this group'
optional :request_access_enabled, type: Boolean, desc: 'Allow users to request member access'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment