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
1a7a861f
Commit
1a7a861f
authored
Oct 23, 2018
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract EE-specific lines from issues controller
parent
506a5f8f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
12 deletions
+43
-12
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+17
-10
ee/app/controllers/ee/projects/issues_controller.rb
ee/app/controllers/ee/projects/issues_controller.rb
+26
-2
No files found.
app/controllers/projects/issues_controller.rb
View file @
1a7a861f
...
@@ -9,14 +9,27 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -9,14 +9,27 @@ class Projects::IssuesController < Projects::ApplicationController
include
IssuesCalendar
include
IssuesCalendar
include
SpammableActions
include
SpammableActions
prepend_before_action
:authenticate_user!
,
only:
[
:new
,
:export_csv
]
prepend
::
EE
::
Projects
::
IssuesController
def
self
.
authenticate_user_only_actions
%i[new]
end
def
self
.
issue_except_actions
%i[index calendar new create bulk_update]
end
def
self
.
set_issuables_index_only_actions
%i[index calendar]
end
prepend_before_action
:authenticate_user!
,
only:
authenticate_user_only_actions
before_action
:whitelist_query_limiting_ee
,
only:
[
:update
]
before_action
:whitelist_query_limiting
,
only:
[
:create
,
:create_merge_request
,
:move
,
:bulk_update
]
before_action
:whitelist_query_limiting
,
only:
[
:create
,
:create_merge_request
,
:move
,
:bulk_update
]
before_action
:check_issues_available!
before_action
:check_issues_available!
before_action
:issue
,
except:
[
:index
,
:calendar
,
:new
,
:create
,
:bulk_update
,
:export_csv
]
before_action
:issue
,
except:
issue_except_actions
before_action
:set_issuables_index
,
only:
[
:index
,
:calendar
]
before_action
:set_issuables_index
,
only:
set_issuables_index_only_actions
# Allow write(create) issue
# Allow write(create) issue
before_action
:authorize_create_issue!
,
only:
[
:new
,
:create
]
before_action
:authorize_create_issue!
,
only:
[
:new
,
:create
]
...
@@ -27,8 +40,6 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -27,8 +40,6 @@ class Projects::IssuesController < Projects::ApplicationController
# Allow create a new branch and empty WIP merge request from current issue
# Allow create a new branch and empty WIP merge request from current issue
before_action
:authorize_create_merge_request_from!
,
only:
[
:create_merge_request
]
before_action
:authorize_create_merge_request_from!
,
only:
[
:create_merge_request
]
prepend
::
EE
::
Projects
::
IssuesController
respond_to
:html
respond_to
:html
def
index
def
index
...
@@ -254,8 +265,4 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -254,8 +265,4 @@ class Projects::IssuesController < Projects::ApplicationController
# 3. https://gitlab.com/gitlab-org/gitlab-ce/issues/42426
# 3. https://gitlab.com/gitlab-org/gitlab-ce/issues/42426
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ce/issues/42422'
)
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ce/issues/42422'
)
end
end
def
whitelist_query_limiting_ee
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ee/issues/4794'
)
end
end
end
ee/app/controllers/ee/projects/issues_controller.rb
View file @
1a7a861f
# frozen_string_literal: true
module
EE
module
EE
module
Projects
module
Projects
module
IssuesController
module
IssuesController
...
@@ -6,8 +8,26 @@ module EE
...
@@ -6,8 +8,26 @@ module EE
prepended
do
prepended
do
before_action
:check_export_issues_available!
,
only:
[
:export_csv
]
before_action
:check_export_issues_available!
,
only:
[
:export_csv
]
before_action
:check_service_desk_available!
,
only:
[
:service_desk
]
before_action
:check_service_desk_available!
,
only:
[
:service_desk
]
before_action
:set_issuables_index
,
only:
[
:index
,
:calendar
,
:service_desk
]
before_action
:whitelist_query_limiting_ee
,
only:
[
:update
]
skip_before_action
:issue
,
only:
[
:service_desk
]
end
class_methods
do
extend
::
Gitlab
::
Utils
::
Override
override
:authenticate_user_only_actions
def
authenticate_user_only_actions
super
+
%i[export_csv]
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
end
end
def
service_desk
def
service_desk
...
@@ -46,6 +66,10 @@ module EE
...
@@ -46,6 +66,10 @@ module EE
def
service_desk?
def
service_desk?
action_name
==
'service_desk'
action_name
==
'service_desk'
end
end
def
whitelist_query_limiting_ee
::
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ee/issues/4794'
)
end
end
end
end
end
end
end
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