Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-22 15:38:48 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-22 15:38:48 +0400
commite089b11b7a4026acc7706e519682f4b7141b2bcd (patch)
tree12d55ce5e41d6483af225103475ebda8cef2b8a3 /app/helpers/branches_helper.rb
parent88781783dd425d1ba4ff5cacf9b4cc4c23a9a35e (diff)
Add BranchesHelper
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers/branches_helper.rb')
-rw-r--r--app/helpers/branches_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/branches_helper.rb b/app/helpers/branches_helper.rb
new file mode 100644
index 00000000000..e08ffccb94c
--- /dev/null
+++ b/app/helpers/branches_helper.rb
@@ -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