summaryrefslogtreecommitdiff
path: root/app/helpers/tree_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/tree_helper.rb')
-rw-r--r--app/helpers/tree_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb
index c681dc607a0..4fe87a25554 100644
--- a/app/helpers/tree_helper.rb
+++ b/app/helpers/tree_helper.rb
@@ -59,4 +59,12 @@ module TreeHelper
def tree_join(*args)
File.join(*args)
end
+
+ def allowed_tree_edit?
+ if @project.protected_branch? @ref
+ can?(current_user, :push_code_to_protected_branches, @project)
+ else
+ can?(current_user, :push_code, @project)
+ end
+ end
end