debian-mirror-gitlab/app/controllers/projects/protected_branches_controller.rb

26 lines
689 B
Ruby
Raw Normal View History

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
2017-08-17 22:00:37 +05:30
def create_service_class
::ProtectedBranches::CreateService
2016-08-24 12:49:21 +05:30
end
2015-04-26 12:48:37 +05:30
2017-08-17 22:00:37 +05:30
def update_service_class
::ProtectedBranches::UpdateService
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
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