mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-24 20:16:08 +10:00
Add BranchesHelper
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
module BranchesHelper
|
||||
def can_remove_branch?(project, branch_name)
|
||||
if project.protected_branch? branch_name
|
||||
false
|
||||
elsif branch_name == project.repository.root_ref
|
||||
false
|
||||
else
|
||||
can?(current_user, :push_code, project)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user