From dd071c4b6e9754a0abeec45ab2040d9e2d5a62b8 Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Mon, 19 Feb 2018 16:06:16 -0300 Subject: Bring one group board to CE --- app/controllers/boards/issues_controller.rb | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'app/controllers/boards') diff --git a/app/controllers/boards/issues_controller.rb b/app/controllers/boards/issues_controller.rb index 352f12a89fd..35571fa9603 100644 --- a/app/controllers/boards/issues_controller.rb +++ b/app/controllers/boards/issues_controller.rb @@ -1,12 +1,14 @@ module Boards class IssuesController < Boards::ApplicationController include BoardsResponses + include ControllerWithCrossProjectAccessCheck + + requires_cross_project_access if: -> { board&.group_board? } before_action :whitelist_query_limiting, only: [:index, :update] before_action :authorize_read_issue, only: [:index] before_action :authorize_create_issue, only: [:create] before_action :authorize_update_issue, only: [:update] - skip_before_action :authenticate_user!, only: [:index] def index issues = Boards::Issues::ListService.new(board_parent, current_user, filter_params).execute @@ -64,11 +66,21 @@ module Boards end def issues_finder - IssuesFinder.new(current_user, project_id: board_parent.id) + if board.group_board? + IssuesFinder.new(current_user, group_id: board_parent.id) + else + IssuesFinder.new(current_user, project_id: board_parent.id) + end end def project - board_parent + @project ||= begin + if board.group_board? + Project.find(issue_params[:project_id]) + else + board_parent + end + end end def move_params -- cgit v1.2.3