Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
63e8e2c3
Commit
63e8e2c3
authored
May 29, 2019
by
Imre Farkas
Committed by
Lin Jen-Shin
May 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CE port of Move EE specific lines in API::ProtectedBranches
parent
65d65fed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
23 deletions
+16
-23
lib/api/helpers/protected_branches_helpers.rb
lib/api/helpers/protected_branches_helpers.rb
+13
-0
lib/api/protected_branches.rb
lib/api/protected_branches.rb
+3
-23
No files found.
lib/api/helpers/protected_branches_helpers.rb
0 → 100644
View file @
63e8e2c3
# frozen_string_literal: true
module
API
module
Helpers
module
ProtectedBranchesHelpers
extend
ActiveSupport
::
Concern
extend
Grape
::
API
::
Helpers
params
:optional_params_ee
do
end
end
end
end
lib/api/protected_branches.rb
View file @
63e8e2c3
...
@@ -8,6 +8,8 @@ module API
...
@@ -8,6 +8,8 @@ module API
before
{
authorize_admin_project
}
before
{
authorize_admin_project
}
helpers
Helpers
::
ProtectedBranchesHelpers
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
...
@@ -52,29 +54,7 @@ module API
...
@@ -52,29 +54,7 @@ module API
values:
ProtectedBranch
::
MergeAccessLevel
.
allowed_access_levels
,
values:
ProtectedBranch
::
MergeAccessLevel
.
allowed_access_levels
,
desc:
'Access levels allowed to merge (defaults: `40`, maintainer access level)'
desc:
'Access levels allowed to merge (defaults: `40`, maintainer access level)'
if
Gitlab
.
ee?
use
:optional_params_ee
optional
:unprotect_access_level
,
type:
Integer
,
values:
ProtectedBranch
::
UnprotectAccessLevel
.
allowed_access_levels
,
desc:
'Access levels allowed to unprotect (defaults: `40`, maintainer access level)'
optional
:allowed_to_push
,
type:
Array
,
desc:
'An array of users/groups allowed to push'
do
optional
:access_level
,
type:
Integer
,
values:
ProtectedBranch
::
PushAccessLevel
.
allowed_access_levels
optional
:user_id
,
type:
Integer
optional
:group_id
,
type:
Integer
end
optional
:allowed_to_merge
,
type:
Array
,
desc:
'An array of users/groups allowed to merge'
do
optional
:access_level
,
type:
Integer
,
values:
ProtectedBranch
::
MergeAccessLevel
.
allowed_access_levels
optional
:user_id
,
type:
Integer
optional
:group_id
,
type:
Integer
end
optional
:allowed_to_unprotect
,
type:
Array
,
desc:
'An array of users/groups allowed to unprotect'
do
optional
:access_level
,
type:
Integer
,
values:
ProtectedBranch
::
UnprotectAccessLevel
.
allowed_access_levels
optional
:user_id
,
type:
Integer
optional
:group_id
,
type:
Integer
end
end
end
end
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
post
':id/protected_branches'
do
post
':id/protected_branches'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment