diff options
author | Felipe Artur <felipefac@gmail.com> | 2018-02-19 22:06:16 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2018-03-03 18:56:17 +0300 |
commit | dd071c4b6e9754a0abeec45ab2040d9e2d5a62b8 (patch) | |
tree | 9dda99bb987378cb6cbc95d236757d11f21176a6 /app/controllers/boards | |
parent | 98fecb5f8e64c4c64c96d065bc342d986140367e (diff) |
Bring one group board to CE
Diffstat (limited to 'app/controllers/boards')
-rw-r--r-- | app/controllers/boards/issues_controller.rb | 18 |
1 files changed, 15 insertions, 3 deletions
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 |