Backport changes to API::ProtectedBranches
This backports EE specific parameters EE adds to API::ProtectedBranches, and wraps them in a conditional.
This commit is contained in:
parent
be49d9c1ba
commit
05534daa1c
|
@ -51,6 +51,30 @@ module API
|
|||
optional :merge_access_level, type: Integer,
|
||||
values: ProtectedBranch::MergeAccessLevel.allowed_access_levels,
|
||||
desc: 'Access levels allowed to merge (defaults: `40`, maintainer access level)'
|
||||
|
||||
if Gitlab.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
|
||||
# rubocop: disable CodeReuse/ActiveRecord
|
||||
post ':id/protected_branches' do
|
||||
|
|
Loading…
Reference in New Issue