diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-22 14:38:48 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-22 14:38:48 +0300 |
commit | e089b11b7a4026acc7706e519682f4b7141b2bcd (patch) | |
tree | 12d55ce5e41d6483af225103475ebda8cef2b8a3 /app | |
parent | 88781783dd425d1ba4ff5cacf9b4cc4c23a9a35e (diff) | |
download | gitlab-ce-e089b11b7a4026acc7706e519682f4b7141b2bcd.tar.gz |
Add BranchesHelper
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/branches_helper.rb | 11 |
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 |