diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-20 15:40:28 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-20 15:40:28 +0000 |
commit | b595cb0c1dec83de5bdee18284abe86614bed33b (patch) | |
tree | 8c3d4540f193c5ff98019352f554e921b3a41a72 /lib/api/protected_tags.rb | |
parent | 2f9104a328fc8a4bddeaa4627b595166d24671d0 (diff) | |
download | gitlab-ce-b595cb0c1dec83de5bdee18284abe86614bed33b.tar.gz |
Add latest changes from gitlab-org/gitlab@15-2-stable-eev15.2.0-rc42
Diffstat (limited to 'lib/api/protected_tags.rb')
-rw-r--r-- | lib/api/protected_tags.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/api/protected_tags.rb b/lib/api/protected_tags.rb index b9385df1f8d..4611ee58479 100644 --- a/lib/api/protected_tags.rb +++ b/lib/api/protected_tags.rb @@ -10,6 +10,8 @@ module API feature_category :source_code_management + helpers Helpers::ProtectedTagsHelpers + params do requires :id, type: String, desc: 'The ID of a project' end @@ -50,14 +52,15 @@ module API end params do requires :name, type: String, desc: 'The name of the protected tag' - optional :create_access_level, type: Integer, default: Gitlab::Access::MAINTAINER, + optional :create_access_level, type: Integer, values: ProtectedTag::CreateAccessLevel.allowed_access_levels, desc: 'Access levels allowed to create (defaults: `40`, maintainer access level)' + use :optional_params_ee end post ':id/protected_tags' do protected_tags_params = { name: params[:name], - create_access_levels_attributes: [{ access_level: params[:create_access_level] }] + create_access_levels_attributes: ::ProtectedRefs::AccessLevelParams.new(:create, params).access_levels } protected_tag = ::ProtectedTags::CreateService.new(user_project, |