diff options
author | Sean McGivern <sean@gitlab.com> | 2018-10-24 10:13:58 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-10-24 10:13:58 +0100 |
commit | 02268a85be615877b9080a8c931ad93ae73ef2e2 (patch) | |
tree | e11b6444c14f634ab9caa5360b00c5583c5ffb4e /app | |
parent | a84469a34596d0f3588f7ae16646489441241bc6 (diff) | |
download | gitlab-ce-02268a85be615877b9080a8c931ad93ae73ef2e2.tar.gz |
Extract EE-specific lines from issues controller
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/issues_controller.rb | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index b06a6f3bb0d..308f666394c 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -9,12 +9,25 @@ class Projects::IssuesController < Projects::ApplicationController include IssuesCalendar include SpammableActions - prepend_before_action :authenticate_user!, only: [:new] + 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, only: [:create, :create_merge_request, :move, :bulk_update] before_action :check_issues_available! - before_action :issue, except: [:index, :calendar, :new, :create, :bulk_update] - before_action :set_issuables_index, only: [:index, :calendar] + before_action :issue, except: issue_except_actions + + before_action :set_issuables_index, only: set_issuables_index_only_actions # Allow write(create) issue before_action :authorize_create_issue!, only: [:new, :create] |