ProtectedBranches model, Master permission for repo\n Allow push to protected branch for masters only
This commit is contained in:
parent
3a9e5a9357
commit
37224dc9c1
14 changed files with 229 additions and 53 deletions
23
app/controllers/protected_branches_controller.rb
Normal file
23
app/controllers/protected_branches_controller.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
class ProtectedBranchesController < ApplicationController
|
||||
before_filter :project
|
||||
|
||||
# Authorize
|
||||
before_filter :add_project_abilities
|
||||
before_filter :authorize_read_project!
|
||||
before_filter :require_non_empty_project
|
||||
|
||||
layout "project"
|
||||
|
||||
def index
|
||||
@branches = @project.protected_branches.all
|
||||
@protected_branch = @project.protected_branches.new
|
||||
end
|
||||
|
||||
def create
|
||||
@project.protected_branches.create(params[:protected_branch])
|
||||
redirect_to project_protected_branches_path(@project)
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue