Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/protected_tags.rb')
-rw-r--r--lib/api/protected_tags.rb7
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,