Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
caaa2387
Commit
caaa2387
authored
Dec 19, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move all the prepend in controllers to bottoms
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
3ac99fb3
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
56 additions
and
54 deletions
+56
-54
app/controllers/admin/application_controller.rb
app/controllers/admin/application_controller.rb
+2
-2
app/controllers/admin/dashboard_controller.rb
app/controllers/admin/dashboard_controller.rb
+2
-2
app/controllers/admin/projects_controller.rb
app/controllers/admin/projects_controller.rb
+2
-1
app/controllers/boards/lists_controller.rb
app/controllers/boards/lists_controller.rb
+2
-2
app/controllers/confirmations_controller.rb
app/controllers/confirmations_controller.rb
+2
-2
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+1
-0
app/controllers/import/github_controller.rb
app/controllers/import/github_controller.rb
+2
-2
app/controllers/ldap/omniauth_callbacks_controller.rb
app/controllers/ldap/omniauth_callbacks_controller.rb
+0
-1
app/controllers/projects/autocomplete_sources_controller.rb
app/controllers/projects/autocomplete_sources_controller.rb
+2
-2
app/controllers/projects/environments_controller.rb
app/controllers/projects/environments_controller.rb
+2
-2
app/controllers/projects/git_http_client_controller.rb
app/controllers/projects/git_http_client_controller.rb
+2
-1
app/controllers/projects/git_http_controller.rb
app/controllers/projects/git_http_controller.rb
+2
-1
app/controllers/projects/group_links_controller.rb
app/controllers/projects/group_links_controller.rb
+1
-1
app/controllers/projects/imports_controller.rb
app/controllers/projects/imports_controller.rb
+1
-1
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+6
-6
app/controllers/projects/lfs_api_controller.rb
app/controllers/projects/lfs_api_controller.rb
+1
-1
app/controllers/projects/merge_requests/application_controller.rb
...rollers/projects/merge_requests/application_controller.rb
+2
-2
app/controllers/projects/merge_requests/diffs_controller.rb
app/controllers/projects/merge_requests/diffs_controller.rb
+2
-2
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+2
-2
app/controllers/projects/pipelines_controller.rb
app/controllers/projects/pipelines_controller.rb
+2
-2
app/controllers/projects/protected_refs_controller.rb
app/controllers/projects/protected_refs_controller.rb
+1
-1
app/controllers/projects/settings/ci_cd_controller.rb
app/controllers/projects/settings/ci_cd_controller.rb
+2
-2
app/controllers/projects/settings/repository_controller.rb
app/controllers/projects/settings/repository_controller.rb
+2
-2
app/controllers/projects/variables_controller.rb
app/controllers/projects/variables_controller.rb
+2
-2
app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
+1
-0
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+1
-0
ee/app/controllers/ee/projects/git_http_client_controller.rb
ee/app/controllers/ee/projects/git_http_client_controller.rb
+1
-1
ee/app/controllers/ee/projects/issues_controller.rb
ee/app/controllers/ee/projects/issues_controller.rb
+8
-11
No files found.
app/controllers/admin/application_controller.rb
View file @
caaa2387
...
...
@@ -4,8 +4,6 @@
#
# Automatically sets the layout and ensures an administrator is logged in
class
Admin::ApplicationController
<
ApplicationController
prepend
EE
::
Admin
::
ApplicationController
# rubocop: disable Cop/InjectEnterpriseEditionModule
before_action
:authenticate_admin!
layout
'admin'
...
...
@@ -13,3 +11,5 @@ class Admin::ApplicationController < ApplicationController
render_404
unless
current_user
.
admin?
end
end
Admin
::
ApplicationController
.
prepend
(
EE
::
Admin
::
ApplicationController
)
app/controllers/admin/dashboard_controller.rb
View file @
caaa2387
# frozen_string_literal: true
class
Admin::DashboardController
<
Admin
::
ApplicationController
prepend
::
EE
::
Admin
::
DashboardController
# rubocop: disable Cop/InjectEnterpriseEditionModule
include
CountHelper
COUNTED_ITEMS
=
[
Project
,
User
,
Group
,
ForkNetworkMember
,
ForkNetwork
,
Issue
,
...
...
@@ -17,3 +15,5 @@ class Admin::DashboardController < Admin::ApplicationController
end
# rubocop: enable CodeReuse/ActiveRecord
end
Admin
::
DashboardController
.
prepend
(
EE
::
Admin
::
DashboardController
)
app/controllers/admin/projects_controller.rb
View file @
caaa2387
# frozen_string_literal: true
class
Admin::ProjectsController
<
Admin
::
ApplicationController
prepend
EE
::
Admin
::
ProjectsController
# rubocop: disable Cop/InjectEnterpriseEditionModule
include
MembersPresentation
before_action
:project
,
only:
[
:show
,
:transfer
,
:repository_check
]
...
...
@@ -68,3 +67,5 @@ class Admin::ProjectsController < Admin::ApplicationController
@group
||=
@project
.
group
end
end
Admin
::
ProjectsController
.
prepend
(
EE
::
Admin
::
ProjectsController
)
app/controllers/boards/lists_controller.rb
View file @
caaa2387
...
...
@@ -2,8 +2,6 @@
module
Boards
class
ListsController
<
Boards
::
ApplicationController
prepend
::
EE
::
Boards
::
ListsController
# rubocop: disable Cop/InjectEnterpriseEditionModule
include
BoardsResponses
before_action
:authorize_admin_list
,
only:
[
:create
,
:update
,
:destroy
,
:generate
]
...
...
@@ -85,3 +83,5 @@ module Boards
end
end
end
Boards
::
ListsController
.
prepend
(
EE
::
Boards
::
ListsController
)
app/controllers/confirmations_controller.rb
View file @
caaa2387
# frozen_string_literal: true
class
ConfirmationsController
<
Devise
::
ConfirmationsController
prepend
::
EE
::
ConfirmationsController
# rubocop: disable Cop/InjectEnterpriseEditionModule
include
AcceptsPendingInvitations
def
almost_there
...
...
@@ -33,3 +31,5 @@ class ConfirmationsController < Devise::ConfirmationsController
after_sign_in_path_for
(
resource
)
end
end
ConfirmationsController
.
prepend
(
EE
::
ConfirmationsController
)
app/controllers/groups_controller.rb
View file @
caaa2387
...
...
@@ -6,6 +6,7 @@ class GroupsController < Groups::ApplicationController
include
MergeRequestsAction
include
ParamsBackwardCompatibility
include
PreviewMarkdown
respond_to
:html
prepend_before_action
(
only:
[
:show
,
:issues
])
{
authenticate_sessionless_user!
(
:rss
)
}
...
...
app/controllers/import/github_controller.rb
View file @
caaa2387
# frozen_string_literal: true
class
Import::GithubController
<
Import
::
BaseController
prepend
::
EE
::
Import
::
GithubController
# rubocop: disable Cop/InjectEnterpriseEditionModule
before_action
:verify_import_enabled
before_action
:provider_auth
,
only:
[
:status
,
:jobs
,
:create
]
...
...
@@ -127,3 +125,5 @@ class Import::GithubController < Import::BaseController
{}
end
end
Import
::
GithubController
.
prepend
(
EE
::
Import
::
GithubController
)
app/controllers/ldap/omniauth_callbacks_controller.rb
View file @
caaa2387
...
...
@@ -32,5 +32,4 @@ class Ldap::OmniauthCallbacksController < OmniauthCallbacksController
end
end
Ldap
::
OmniauthCallbacksController
.
prepend
(
EE
::
OmniauthCallbacksController
)
# rubocop: disable Cop/InjectEnterpriseEditionModule
Ldap
::
OmniauthCallbacksController
.
prepend
(
EE
::
Ldap
::
OmniauthCallbacksController
)
app/controllers/projects/autocomplete_sources_controller.rb
View file @
caaa2387
# frozen_string_literal: true
class
Projects::AutocompleteSourcesController
<
Projects
::
ApplicationController
prepend
EE
::
Projects
::
AutocompleteSourcesController
# rubocop: disable Cop/InjectEnterpriseEditionModule
def
members
render
json:
::
Projects
::
ParticipantsService
.
new
(
@project
,
current_user
).
execute
(
target
)
end
...
...
@@ -43,3 +41,5 @@ class Projects::AutocompleteSourcesController < Projects::ApplicationController
.
execute
(
params
[
:type
],
params
[
:type_id
])
end
end
Projects
::
AutocompleteSourcesController
.
prepend
(
EE
::
Projects
::
AutocompleteSourcesController
)
app/controllers/projects/environments_controller.rb
View file @
caaa2387
...
...
@@ -15,8 +15,6 @@ class Projects::EnvironmentsController < Projects::ApplicationController
push_frontend_feature_flag
(
:area_chart
,
project
)
end
prepend
::
EE
::
Projects
::
EnvironmentsController
# rubocop: disable Cop/InjectEnterpriseEditionModule
def
index
@environments
=
project
.
environments
.
with_state
(
params
[
:scope
]
||
:available
)
...
...
@@ -192,3 +190,5 @@ class Projects::EnvironmentsController < Projects::ApplicationController
access_denied!
unless
can?
(
current_user
,
:stop_environment
,
environment
)
end
end
Projects
::
EnvironmentsController
.
prepend
(
EE
::
Projects
::
EnvironmentsController
)
app/controllers/projects/git_http_client_controller.rb
View file @
caaa2387
...
...
@@ -5,7 +5,6 @@
class
Projects::GitHttpClientController
<
Projects
::
ApplicationController
include
ActionController
::
HttpAuthentication
::
Basic
include
KerberosSpnegoHelper
prepend
::
EE
::
Projects
::
GitHttpClientController
# rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader
:authentication_result
,
:redirected_path
...
...
@@ -110,3 +109,5 @@ class Projects::GitHttpClientController < Projects::ApplicationController
authentication_result
.
ci?
(
project
)
end
end
Projects
::
GitHttpClientController
.
prepend
(
EE
::
Projects
::
GitHttpClientController
)
app/controllers/projects/git_http_controller.rb
View file @
caaa2387
...
...
@@ -2,7 +2,6 @@
class
Projects::GitHttpController
<
Projects
::
GitHttpClientController
include
WorkhorseRequest
prepend
::
EE
::
Projects
::
GitHttpController
# rubocop: disable Cop/InjectEnterpriseEditionModule
before_action
:access_check
...
...
@@ -97,3 +96,5 @@ class Projects::GitHttpController < Projects::GitHttpClientController
Users
::
ActivityService
.
new
(
user
,
'pull'
).
execute
end
end
Projects
::
GitHttpController
.
prepend
(
EE
::
Projects
::
GitHttpController
)
app/controllers/projects/group_links_controller.rb
View file @
caaa2387
...
...
@@ -53,4 +53,4 @@ class Projects::GroupLinksController < Projects::ApplicationController
end
end
Projects
::
GroupLinksController
.
prepend
(
::
EE
::
Projects
::
GroupLinksController
)
Projects
::
GroupLinksController
.
prepend
(
EE
::
Projects
::
GroupLinksController
)
app/controllers/projects/imports_controller.rb
View file @
caaa2387
...
...
@@ -75,4 +75,4 @@ class Projects::ImportsController < Projects::ApplicationController
end
end
Projects
::
ImportsController
.
prepend
(
::
EE
::
Projects
::
ImportsController
)
Projects
::
ImportsController
.
prepend
(
EE
::
Projects
::
ImportsController
)
app/controllers/projects/issues_controller.rb
View file @
caaa2387
...
...
@@ -9,13 +9,11 @@ class Projects::IssuesController < Projects::ApplicationController
include
IssuesCalendar
include
SpammableActions
prepend
::
EE
::
Projects
::
IssuesController
# rubocop: disable Cop/InjectEnterpriseEditionModule
def
self
.
issue_except_actions
def
issue_except_actions
%i[index calendar new create bulk_update import_csv]
end
def
se
lf
.
se
t_issuables_index_only_actions
def
set_issuables_index_only_actions
%i[index calendar]
end
...
...
@@ -26,9 +24,9 @@ class Projects::IssuesController < Projects::ApplicationController
before_action
:whitelist_query_limiting
,
only:
[
:create
,
:create_merge_request
,
:move
,
:bulk_update
]
before_action
:check_issues_available!
before_action
:issue
,
except:
issue_except_actions
before_action
:issue
,
unless:
->
(
c
)
{
c
.
issue_except_actions
.
include?
(
c
.
action_name
.
to_sym
)
}
before_action
:set_issuables_index
,
only:
set_issuables_index_only_actions
before_action
:set_issuables_index
,
if:
->
(
c
)
{
c
.
set_issuables_index_only_actions
.
include?
(
c
.
action_name
.
to_sym
)
}
# Allow write(create) issue
before_action
:authorize_create_issue!
,
only:
[
:new
,
:create
]
...
...
@@ -287,3 +285,5 @@ class Projects::IssuesController < Projects::ApplicationController
push_frontend_feature_flag
(
:graphql
,
default_enabled:
true
)
end
end
Projects
::
IssuesController
.
prepend
(
EE
::
Projects
::
IssuesController
)
app/controllers/projects/lfs_api_controller.rb
View file @
caaa2387
...
...
@@ -124,4 +124,4 @@ class Projects::LfsApiController < Projects::GitHttpClientController
end
end
Projects
::
LfsApiController
.
prepend
(
::
EE
::
Projects
::
LfsApiController
)
Projects
::
LfsApiController
.
prepend
(
EE
::
Projects
::
LfsApiController
)
app/controllers/projects/merge_requests/application_controller.rb
View file @
caaa2387
# frozen_string_literal: true
class
Projects::MergeRequests::ApplicationController
<
Projects
::
ApplicationController
prepend
::
EE
::
Projects
::
MergeRequests
::
ApplicationController
# rubocop: disable Cop/InjectEnterpriseEditionModule
before_action
:check_merge_requests_available!
before_action
:merge_request
before_action
:authorize_read_merge_request!
...
...
@@ -46,3 +44,5 @@ class Projects::MergeRequests::ApplicationController < Projects::ApplicationCont
@statuses_count
=
@pipeline
.
present?
?
@pipeline
.
statuses
.
relevant
.
count
:
0
end
end
Projects
::
MergeRequests
::
ApplicationController
.
prepend
(
EE
::
Projects
::
MergeRequests
::
ApplicationController
)
app/controllers/projects/merge_requests/diffs_controller.rb
View file @
caaa2387
# frozen_string_literal: true
class
Projects::MergeRequests::DiffsController
<
Projects
::
MergeRequests
::
ApplicationController
prepend
::
EE
::
Projects
::
MergeRequests
::
DiffsController
# rubocop: disable Cop/InjectEnterpriseEditionModule
include
DiffForPath
include
DiffHelper
include
RendersNotes
...
...
@@ -120,3 +118,5 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic
@notes
end
end
Projects
::
MergeRequests
::
DiffsController
.
prepend
(
EE
::
Projects
::
MergeRequests
::
DiffsController
)
app/controllers/projects/merge_requests_controller.rb
View file @
caaa2387
...
...
@@ -8,8 +8,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
include
ToggleAwardEmoji
include
IssuableCollections
prepend
::
EE
::
Projects
::
MergeRequestsController
# rubocop: disable Cop/InjectEnterpriseEditionModule
skip_before_action
:merge_request
,
only:
[
:index
,
:bulk_update
]
before_action
:whitelist_query_limiting
,
only:
[
:assign_related_issues
,
:update
]
before_action
:authorize_update_issuable!
,
only:
[
:close
,
:edit
,
:update
,
:remove_wip
,
:sort
]
...
...
@@ -349,3 +347,5 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ce/issues/42438'
)
end
end
Projects
::
MergeRequestsController
.
prepend
(
EE
::
Projects
::
MergeRequestsController
)
app/controllers/projects/pipelines_controller.rb
View file @
caaa2387
# frozen_string_literal: true
class
Projects::PipelinesController
<
Projects
::
ApplicationController
prepend
::
EE
::
Projects
::
PipelinesController
# rubocop: disable Cop/InjectEnterpriseEditionModule
before_action
:whitelist_query_limiting
,
only:
[
:create
,
:retry
]
before_action
:pipeline
,
except:
[
:index
,
:new
,
:create
,
:charts
]
before_action
:authorize_read_pipeline!
...
...
@@ -188,3 +186,5 @@ class Projects::PipelinesController < Projects::ApplicationController
view_context
.
limited_counter_with_delimiter
(
finder
.
execute
)
end
end
Projects
::
PipelinesController
.
prepend
(
EE
::
Projects
::
PipelinesController
)
app/controllers/projects/protected_refs_controller.rb
View file @
caaa2387
...
...
@@ -66,4 +66,4 @@ class Projects::ProtectedRefsController < Projects::ApplicationController
end
end
Projects
::
ProtectedRefsController
.
prepend
(
::
EE
::
Projects
::
ProtectedRefsController
)
Projects
::
ProtectedRefsController
.
prepend
(
EE
::
Projects
::
ProtectedRefsController
)
app/controllers/projects/settings/ci_cd_controller.rb
View file @
caaa2387
...
...
@@ -6,8 +6,6 @@ module Projects
before_action
:authorize_admin_pipeline!
before_action
:define_variables
prepend
::
EE
::
Projects
::
Settings
::
CiCdController
# rubocop: disable Cop/InjectEnterpriseEditionModule
def
show
end
...
...
@@ -121,3 +119,5 @@ module Projects
end
end
end
Projects
::
Settings
::
CiCdController
.
prepend
(
EE
::
Projects
::
Settings
::
CiCdController
)
app/controllers/projects/settings/repository_controller.rb
View file @
caaa2387
...
...
@@ -6,8 +6,6 @@ module Projects
before_action
:authorize_admin_project!
before_action
:remote_mirror
,
only:
[
:show
]
prepend
::
EE
::
Projects
::
Settings
::
RepositoryController
# rubocop: disable Cop/InjectEnterpriseEditionModule
def
show
render_show
end
...
...
@@ -106,3 +104,5 @@ module Projects
end
end
end
Projects
::
Settings
::
RepositoryController
.
prepend
(
EE
::
Projects
::
Settings
::
RepositoryController
)
app/controllers/projects/variables_controller.rb
View file @
caaa2387
# frozen_string_literal: true
class
Projects::VariablesController
<
Projects
::
ApplicationController
prepend
::
EE
::
Projects
::
VariablesController
# rubocop: disable Cop/InjectEnterpriseEditionModule
before_action
:authorize_admin_build!
def
show
...
...
@@ -43,3 +41,5 @@ class Projects::VariablesController < Projects::ApplicationController
%i[id key secret_value protected _destroy]
end
end
Projects
::
VariablesController
.
prepend
(
EE
::
Projects
::
VariablesController
)
app/controllers/sessions_controller.rb
View file @
caaa2387
...
...
@@ -6,6 +6,7 @@ class SessionsController < Devise::SessionsController
include
Devise
::
Controllers
::
Rememberable
include
Recaptcha
::
ClientHelper
include
Recaptcha
::
Verify
skip_before_action
:check_two_factor_requirement
,
only:
[
:destroy
]
prepend_before_action
:check_initial_setup
,
only:
[
:new
]
...
...
app/controllers/users_controller.rb
View file @
caaa2387
...
...
@@ -4,6 +4,7 @@ class UsersController < ApplicationController
include
RoutableActions
include
RendersMemberAccess
include
ControllerWithCrossProjectAccessCheck
requires_cross_project_access
show:
false
,
groups:
false
,
projects:
false
,
...
...
ee/app/controllers/ee/projects/git_http_client_controller.rb
View file @
caaa2387
...
...
@@ -29,7 +29,7 @@ module EE
# git-lfs: https://github.com/git-lfs/git-lfs/blob/master/docs/api
#
prepended
do
before_action
do
prepend_
before_action
do
redirect_to
(
primary_full_url
)
if
redirect?
end
end
...
...
ee/app/controllers/ee/projects/issues_controller.rb
View file @
caaa2387
...
...
@@ -4,6 +4,7 @@ module EE
module
Projects
module
IssuesController
extend
ActiveSupport
::
Concern
extend
::
Gitlab
::
Utils
::
Override
prepended
do
before_action
:authenticate_user!
,
only:
[
:export_csv
]
...
...
@@ -12,18 +13,14 @@ module EE
before_action
:whitelist_query_limiting_ee
,
only:
[
:update
]
end
class_methods
do
extend
::
Gitlab
::
Utils
::
Override
override
:issue_except_actions
def
issue_except_actions
super
+
%i[export_csv service_desk]
end
override
:issue_except_actions
def
issue_except_actions
super
+
%i[export_csv service_desk]
end
override
:set_issuables_index_only_actions
def
set_issuables_index_only_actions
super
+
%i[service_desk]
end
override
:set_issuables_index_only_actions
def
set_issuables_index_only_actions
super
+
%i[service_desk]
end
def
service_desk
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment