diff options
author | randx <dmitriy.zaporozhets@gmail.com> | 2012-10-21 13:12:14 +0400 |
---|---|---|
committer | randx <dmitriy.zaporozhets@gmail.com> | 2012-10-21 13:12:14 +0400 |
commit | 0189ee97ed34b74cf0f500d678d4435b17ab6a85 (patch) | |
tree | ed77bf88303ef286cc5123d2b75899e559e3a69d /app/helpers | |
parent | 5ec1ad8b2375bdce7a820df1be3dc67b18ad2bd0 (diff) |
Security for online editor. Replace dev_access?, master_access? with can? method usage
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/tree_helper.rb | 8 |
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 |