2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
class Projects::ProtectedBranchesController < Projects::ProtectedRefsController
|
|
|
|
protected
|
2014-09-02 18:07:02 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def project_refs
|
|
|
|
@project.repository.branches
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
def service_namespace
|
|
|
|
::ProtectedBranches
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def load_protected_ref
|
|
|
|
@protected_ref = @project.protected_branches.find(params[:id])
|
2016-08-24 12:49:21 +05:30
|
|
|
end
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
def access_levels
|
|
|
|
[:merge_access_levels, :push_access_levels]
|
|
|
|
end
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
def protected_ref_params
|
2016-09-13 17:45:13 +05:30
|
|
|
params.require(:protected_branch).permit(:name,
|
2017-09-10 17:25:29 +05:30
|
|
|
merge_access_levels_attributes: access_level_attributes,
|
|
|
|
push_access_levels_attributes: access_level_attributes)
|
2016-09-13 17:45:13 +05:30
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|