Commit ace5c789 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'ce-issue-10671' into 'master'

CE part for extract EE specific lines from issue.rb

See merge request gitlab-org/gitlab-ce!27481
parents 1f942ca3 07cea951
...@@ -10,11 +10,11 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -10,11 +10,11 @@ class Projects::IssuesController < Projects::ApplicationController
include SpammableActions include SpammableActions
include RecordUserLastActivity include RecordUserLastActivity
def self.issue_except_actions def issue_except_actions
%i[index calendar new create bulk_update import_csv] %i[index calendar new create bulk_update import_csv]
end end
def self.set_issuables_index_only_actions def set_issuables_index_only_actions
%i[index calendar] %i[index calendar]
end end
...@@ -25,9 +25,9 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -25,9 +25,9 @@ class Projects::IssuesController < Projects::ApplicationController
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: 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 # Allow write(create) issue
before_action :authorize_create_issue!, only: [:new, :create] before_action :authorize_create_issue!, only: [:new, :create]
......
...@@ -128,10 +128,6 @@ module Issuable ...@@ -128,10 +128,6 @@ module Issuable
assignees.count > 1 assignees.count > 1
end end
def milestone_available?
project_id == milestone&.project_id || project.ancestors_upto.compact.include?(milestone&.group)
end
private private
def milestone_is_valid def milestone_is_valid
...@@ -277,6 +273,10 @@ module Issuable ...@@ -277,6 +273,10 @@ module Issuable
end end
end end
def milestone_available?
project_id == milestone&.project_id || project.ancestors_upto.compact.include?(milestone&.group)
end
def assignee_or_author?(user) def assignee_or_author?(user)
author_id == user.id || assignees.exists?(user.id) author_id == user.id || assignees.exists?(user.id)
end end
......
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