From be18397d82ca16fefed7287c8078a9b41bf37c95 Mon Sep 17 00:00:00 2001 From: Cyril Date: Thu, 27 Sep 2012 20:59:42 +0200 Subject: [PATCH] rename ProjectController to ProjectResourceController --- app/controllers/blame_controller.rb | 2 +- app/controllers/blob_controller.rb | 2 +- app/controllers/commit_controller.rb | 2 +- app/controllers/commits_controller.rb | 2 +- app/controllers/compare_controller.rb | 2 +- app/controllers/deploy_keys_controller.rb | 2 +- app/controllers/hooks_controller.rb | 2 +- app/controllers/issues_controller.rb | 2 +- app/controllers/labels_controller.rb | 2 +- app/controllers/merge_requests_controller.rb | 2 +- app/controllers/milestones_controller.rb | 2 +- app/controllers/notes_controller.rb | 2 +- .../{project_controller.rb => project_resource_controller.rb} | 2 +- app/controllers/projects_controller.rb | 2 +- app/controllers/protected_branches_controller.rb | 2 +- app/controllers/refs_controller.rb | 2 +- app/controllers/repositories_controller.rb | 2 +- app/controllers/snippets_controller.rb | 2 +- app/controllers/team_members_controller.rb | 2 +- app/controllers/tree_controller.rb | 2 +- app/controllers/wikis_controller.rb | 2 +- .../layouts/{project.html.haml => project_resource.html.haml} | 0 22 files changed, 21 insertions(+), 21 deletions(-) rename app/controllers/{project_controller.rb => project_resource_controller.rb} (59%) rename app/views/layouts/{project.html.haml => project_resource.html.haml} (100%) diff --git a/app/controllers/blame_controller.rb b/app/controllers/blame_controller.rb index e3fb69b5..37d7245c 100644 --- a/app/controllers/blame_controller.rb +++ b/app/controllers/blame_controller.rb @@ -1,5 +1,5 @@ # Controller for viewing a file's blame -class BlameController < ProjectController +class BlameController < ProjectResourceController include ExtractsPath # Authorize diff --git a/app/controllers/blob_controller.rb b/app/controllers/blob_controller.rb index 30c704f2..30069d19 100644 --- a/app/controllers/blob_controller.rb +++ b/app/controllers/blob_controller.rb @@ -1,5 +1,5 @@ # Controller for viewing a file's blame -class BlobController < ProjectController +class BlobController < ProjectResourceController include ExtractsPath include Gitlab::Encode diff --git a/app/controllers/commit_controller.rb b/app/controllers/commit_controller.rb index 3e1595f1..25a1f0fe 100644 --- a/app/controllers/commit_controller.rb +++ b/app/controllers/commit_controller.rb @@ -1,7 +1,7 @@ # Controller for a specific Commit # # Not to be confused with CommitsController, plural. -class CommitController < ProjectController +class CommitController < ProjectResourceController # Authorize before_filter :authorize_read_project! before_filter :authorize_code_access! diff --git a/app/controllers/commits_controller.rb b/app/controllers/commits_controller.rb index 81a9e90d..3b8ebdb5 100644 --- a/app/controllers/commits_controller.rb +++ b/app/controllers/commits_controller.rb @@ -1,6 +1,6 @@ require "base64" -class CommitsController < ProjectController +class CommitsController < ProjectResourceController include ExtractsPath # Authorize diff --git a/app/controllers/compare_controller.rb b/app/controllers/compare_controller.rb index 96c5c7e1..ae20f9c0 100644 --- a/app/controllers/compare_controller.rb +++ b/app/controllers/compare_controller.rb @@ -1,4 +1,4 @@ -class CompareController < ProjectController +class CompareController < ProjectResourceController # Authorize before_filter :authorize_read_project! before_filter :authorize_code_access! diff --git a/app/controllers/deploy_keys_controller.rb b/app/controllers/deploy_keys_controller.rb index 29f924e8..a89ebbcb 100644 --- a/app/controllers/deploy_keys_controller.rb +++ b/app/controllers/deploy_keys_controller.rb @@ -1,4 +1,4 @@ -class DeployKeysController < ProjectController +class DeployKeysController < ProjectResourceController respond_to :html # Authorize diff --git a/app/controllers/hooks_controller.rb b/app/controllers/hooks_controller.rb index 23b81194..b7d25e36 100644 --- a/app/controllers/hooks_controller.rb +++ b/app/controllers/hooks_controller.rb @@ -1,4 +1,4 @@ -class HooksController < ProjectController +class HooksController < ProjectResourceController # Authorize before_filter :authorize_read_project! before_filter :authorize_admin_project!, only: [:new, :create, :destroy] diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 114a6a19..82ae5b37 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -1,4 +1,4 @@ -class IssuesController < ProjectController +class IssuesController < ProjectResourceController before_filter :module_enabled before_filter :issue, only: [:edit, :update, :destroy, :show] helper_method :issues_filter diff --git a/app/controllers/labels_controller.rb b/app/controllers/labels_controller.rb index 203bff56..3cbbb869 100644 --- a/app/controllers/labels_controller.rb +++ b/app/controllers/labels_controller.rb @@ -1,4 +1,4 @@ -class LabelsController < ProjectController +class LabelsController < ProjectResourceController before_filter :module_enabled # Allow read any issue diff --git a/app/controllers/merge_requests_controller.rb b/app/controllers/merge_requests_controller.rb index db6e48d5..f8d84263 100644 --- a/app/controllers/merge_requests_controller.rb +++ b/app/controllers/merge_requests_controller.rb @@ -1,4 +1,4 @@ -class MergeRequestsController < ProjectController +class MergeRequestsController < ProjectResourceController before_filter :module_enabled before_filter :merge_request, only: [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw] before_filter :validates_merge_request, only: [:show, :diffs, :raw] diff --git a/app/controllers/milestones_controller.rb b/app/controllers/milestones_controller.rb index 19baf531..68479a26 100644 --- a/app/controllers/milestones_controller.rb +++ b/app/controllers/milestones_controller.rb @@ -1,4 +1,4 @@ -class MilestonesController < ProjectController +class MilestonesController < ProjectResourceController before_filter :module_enabled before_filter :milestone, only: [:edit, :update, :destroy, :show] diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index 138d5170..7f5f5cd2 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -1,4 +1,4 @@ -class NotesController < ProjectController +class NotesController < ProjectResourceController # Authorize before_filter :authorize_read_note! before_filter :authorize_write_note!, only: [:create] diff --git a/app/controllers/project_controller.rb b/app/controllers/project_resource_controller.rb similarity index 59% rename from app/controllers/project_controller.rb rename to app/controllers/project_resource_controller.rb index de4f317a..d297bba6 100644 --- a/app/controllers/project_controller.rb +++ b/app/controllers/project_resource_controller.rb @@ -1,4 +1,4 @@ -class ProjectController < ApplicationController +class ProjectResourceController < ApplicationController before_filter :project # Authorize before_filter :add_project_abilities diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 81c267a8..13b264a4 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -1,6 +1,6 @@ require Rails.root.join('lib', 'gitlab', 'graph_commit') -class ProjectsController < ProjectController +class ProjectsController < ProjectResourceController skip_before_filter :project, only: [:new, :create] # Authorize diff --git a/app/controllers/protected_branches_controller.rb b/app/controllers/protected_branches_controller.rb index e91c78bd..fd2734ef 100644 --- a/app/controllers/protected_branches_controller.rb +++ b/app/controllers/protected_branches_controller.rb @@ -1,4 +1,4 @@ -class ProtectedBranchesController < ProjectController +class ProtectedBranchesController < ProjectResourceController # Authorize before_filter :authorize_read_project! before_filter :require_non_empty_project diff --git a/app/controllers/refs_controller.rb b/app/controllers/refs_controller.rb index 9c585c93..d3fc816b 100644 --- a/app/controllers/refs_controller.rb +++ b/app/controllers/refs_controller.rb @@ -1,4 +1,4 @@ -class RefsController < ProjectController +class RefsController < ProjectResourceController include Gitlab::Encode # Authorize diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index ef72e2e9..18b240e4 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -1,4 +1,4 @@ -class RepositoriesController < ProjectController +class RepositoriesController < ProjectResourceController # Authorize before_filter :authorize_read_project! before_filter :authorize_code_access! diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb index 03e5cc73..7324a459 100644 --- a/app/controllers/snippets_controller.rb +++ b/app/controllers/snippets_controller.rb @@ -1,4 +1,4 @@ -class SnippetsController < ProjectController +class SnippetsController < ProjectResourceController before_filter :snippet, only: [:show, :edit, :destroy, :update, :raw] # Allow read any snippet diff --git a/app/controllers/team_members_controller.rb b/app/controllers/team_members_controller.rb index 8261acfe..d0b699f6 100644 --- a/app/controllers/team_members_controller.rb +++ b/app/controllers/team_members_controller.rb @@ -1,4 +1,4 @@ -class TeamMembersController < ProjectController +class TeamMembersController < ProjectResourceController # Authorize before_filter :authorize_read_project! before_filter :authorize_admin_project!, except: [:index, :show] diff --git a/app/controllers/tree_controller.rb b/app/controllers/tree_controller.rb index 4d5c409d..2e4ff7d3 100644 --- a/app/controllers/tree_controller.rb +++ b/app/controllers/tree_controller.rb @@ -1,5 +1,5 @@ # Controller for viewing a repository's file structure -class TreeController < ProjectController +class TreeController < ProjectResourceController include ExtractsPath # Authorize diff --git a/app/controllers/wikis_controller.rb b/app/controllers/wikis_controller.rb index f13d0724..a93afe11 100644 --- a/app/controllers/wikis_controller.rb +++ b/app/controllers/wikis_controller.rb @@ -1,4 +1,4 @@ -class WikisController < ProjectController +class WikisController < ProjectResourceController before_filter :authorize_read_wiki! before_filter :authorize_write_wiki!, only: [:edit, :create, :history] before_filter :authorize_admin_wiki!, only: :destroy diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project_resource.html.haml similarity index 100% rename from app/views/layouts/project.html.haml rename to app/views/layouts/project_resource.html.haml