summaryrefslogtreecommitdiff
path: root/app/helpers/tree_helper.rb
diff options
context:
space:
mode:
authorrandx <dmitriy.zaporozhets@gmail.com>2012-10-21 12:12:14 +0300
committerrandx <dmitriy.zaporozhets@gmail.com>2012-10-21 12:12:14 +0300
commit0189ee97ed34b74cf0f500d678d4435b17ab6a85 (patch)
treeed77bf88303ef286cc5123d2b75899e559e3a69d /app/helpers/tree_helper.rb
parent5ec1ad8b2375bdce7a820df1be3dc67b18ad2bd0 (diff)
downloadgitlab-ce-0189ee97ed34b74cf0f500d678d4435b17ab6a85.tar.gz
Security for online editor. Replace dev_access?, master_access? with can? method usage
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