Commit 00408f37 authored by Douwe Maan's avatar Douwe Maan

Move 'require_non_empty_project' filter to front so 'assign_ref_vars' doesn't 404.

parent 6b0199ff
......@@ -2,9 +2,9 @@
class Projects::BlameController < Projects::ApplicationController
include ExtractsPath
before_filter :require_non_empty_project
before_filter :assign_ref_vars
before_filter :authorize_download_code!
before_filter :require_non_empty_project
def show
@blob = @repository.blob_at(@commit.id, @path)
......
......@@ -5,8 +5,8 @@ class Projects::BlobController < Projects::ApplicationController
# Raised when given an invalid file path
class InvalidPathError < StandardError; end
before_filter :authorize_download_code!
before_filter :require_non_empty_project, except: [:new, :create]
before_filter :authorize_download_code!
before_filter :authorize_push_code!, only: [:destroy]
before_filter :assign_blob_vars
before_filter :commit, except: [:new, :create]
......
......@@ -2,7 +2,6 @@ class Projects::BranchesController < Projects::ApplicationController
include ActionView::Helpers::SanitizeHelper
# Authorize
before_filter :require_non_empty_project
before_filter :authorize_download_code!
before_filter :authorize_push_code!, only: [:create, :destroy]
......
......@@ -3,8 +3,8 @@
# Not to be confused with CommitsController, plural.
class Projects::CommitController < Projects::ApplicationController
# Authorize
before_filter :authorize_download_code!
before_filter :require_non_empty_project
before_filter :authorize_download_code!
before_filter :commit
def show
......
......@@ -3,9 +3,9 @@ require "base64"
class Projects::CommitsController < Projects::ApplicationController
include ExtractsPath
before_filter :require_non_empty_project
before_filter :assign_ref_vars
before_filter :authorize_download_code!
before_filter :require_non_empty_project
def show
@repo = @project.repository
......
class Projects::CompareController < Projects::ApplicationController
# Authorize
before_filter :authorize_download_code!
before_filter :require_non_empty_project
before_filter :authorize_download_code!
def index
end
......
class Projects::ForksController < Projects::ApplicationController
# Authorize
before_filter :authorize_download_code!
before_filter :require_non_empty_project
before_filter :authorize_download_code!
def new
@namespaces = current_user.manageable_namespaces
......
class Projects::GraphsController < Projects::ApplicationController
# Authorize
before_filter :authorize_download_code!
before_filter :require_non_empty_project
before_filter :authorize_download_code!
def show
respond_to do |format|
......
......@@ -2,9 +2,9 @@ class Projects::NetworkController < Projects::ApplicationController
include ExtractsPath
include ApplicationHelper
before_filter :require_non_empty_project
before_filter :assign_ref_vars
before_filter :authorize_download_code!
before_filter :require_non_empty_project
def show
respond_to do |format|
......
......@@ -2,9 +2,9 @@
class Projects::RawController < Projects::ApplicationController
include ExtractsPath
before_filter :require_non_empty_project
before_filter :assign_ref_vars
before_filter :authorize_download_code!
before_filter :require_non_empty_project
def show
@blob = @repository.blob_at(@commit.id, @path)
......
class Projects::RefsController < Projects::ApplicationController
include ExtractsPath
before_filter :require_non_empty_project
before_filter :assign_ref_vars
before_filter :authorize_download_code!
before_filter :require_non_empty_project
def switch
respond_to do |format|
......
class Projects::RepositoriesController < Projects::ApplicationController
# Authorize
before_filter :authorize_download_code!
before_filter :require_non_empty_project, except: :create
before_filter :authorize_download_code!
before_filter :authorize_admin_project!, only: :create
def create
......
......@@ -2,9 +2,9 @@
class Projects::TreeController < Projects::ApplicationController
include ExtractsPath
before_filter :require_non_empty_project, except: [:new, :create]
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?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment