summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-26 15:01:51 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-26 15:01:51 -0800
commitc916124178645412a554a6b8b39c05bbd42269c8 (patch)
treed42a3ea6b1b0a9048c609be57a24b2711d9072e3 /app
parent6a2384e0bc7d0b703c8f6af144c85af47eae6630 (diff)
downloadgitlab-ce-c916124178645412a554a6b8b39c05bbd42269c8.tar.gz
Explicitly set before_filter for ref-related controllers
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/blame_controller.rb2
-rw-r--r--app/controllers/projects/commits_controller.rb2
-rw-r--r--app/controllers/projects/network_controller.rb2
-rw-r--r--app/controllers/projects/raw_controller.rb2
-rw-r--r--app/controllers/projects/refs_controller.rb2
-rw-r--r--app/controllers/projects/tree_controller.rb9
6 files changed, 12 insertions, 7 deletions
diff --git a/app/controllers/projects/blame_controller.rb b/app/controllers/projects/blame_controller.rb
index 367d1295f34..106f21b83e6 100644
--- a/app/controllers/projects/blame_controller.rb
+++ b/app/controllers/projects/blame_controller.rb
@@ -2,7 +2,7 @@
class Projects::BlameController < Projects::ApplicationController
include ExtractsPath
- # Authorize
+ before_filter :assign_ref_vars
before_filter :authorize_download_code!
before_filter :require_non_empty_project
diff --git a/app/controllers/projects/commits_controller.rb b/app/controllers/projects/commits_controller.rb
index 9476b6c0284..0a85c36a758 100644
--- a/app/controllers/projects/commits_controller.rb
+++ b/app/controllers/projects/commits_controller.rb
@@ -3,7 +3,7 @@ require "base64"
class Projects::CommitsController < Projects::ApplicationController
include ExtractsPath
- # Authorize
+ before_filter :assign_ref_vars
before_filter :authorize_download_code!
before_filter :require_non_empty_project
diff --git a/app/controllers/projects/network_controller.rb b/app/controllers/projects/network_controller.rb
index ada1aed0df7..59f2a745367 100644
--- a/app/controllers/projects/network_controller.rb
+++ b/app/controllers/projects/network_controller.rb
@@ -2,7 +2,7 @@ class Projects::NetworkController < Projects::ApplicationController
include ExtractsPath
include ApplicationHelper
- # Authorize
+ before_filter :assign_ref_vars
before_filter :authorize_download_code!
before_filter :require_non_empty_project
diff --git a/app/controllers/projects/raw_controller.rb b/app/controllers/projects/raw_controller.rb
index fdbc4c5a098..84888265dc1 100644
--- a/app/controllers/projects/raw_controller.rb
+++ b/app/controllers/projects/raw_controller.rb
@@ -2,7 +2,7 @@
class Projects::RawController < Projects::ApplicationController
include ExtractsPath
- # Authorize
+ before_filter :assign_ref_vars
before_filter :authorize_download_code!
before_filter :require_non_empty_project
diff --git a/app/controllers/projects/refs_controller.rb b/app/controllers/projects/refs_controller.rb
index 67665f5f601..cede0ebe0ae 100644
--- a/app/controllers/projects/refs_controller.rb
+++ b/app/controllers/projects/refs_controller.rb
@@ -1,7 +1,7 @@
class Projects::RefsController < Projects::ApplicationController
include ExtractsPath
- # Authorize
+ before_filter :assign_ref_vars
before_filter :authorize_download_code!
before_filter :require_non_empty_project
diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb
index 4d033b36848..5b52640a4e1 100644
--- a/app/controllers/projects/tree_controller.rb
+++ b/app/controllers/projects/tree_controller.rb
@@ -1,7 +1,12 @@
# Controller for viewing a repository's file structure
-class Projects::TreeController < Projects::BaseTreeController
- def show
+class Projects::TreeController < Projects::ApplicationController
+ include ExtractsPath
+
+ before_filter :assign_ref_vars
+ before_filter :authorize_download_code!
+ before_filter :require_non_empty_project, except: [:new, :create]
+ def show
if tree.entries.empty?
if @repository.blob_at(@commit.id, @path)
redirect_to project_blob_path(@project, File.join(@ref, @path)) and return