2018-09-26 03:45:43 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-01 16:09:41 +00:00
|
|
|
class Projects::BoardsController < Projects::ApplicationController
|
2019-06-17 12:58:48 +00:00
|
|
|
include MultipleBoardsActions
|
2017-08-31 17:48:57 +00:00
|
|
|
include IssuableCollections
|
2016-08-15 22:50:23 +00:00
|
|
|
|
2018-01-08 09:06:25 +00:00
|
|
|
before_action :check_issues_available!
|
2016-10-05 19:24:29 +00:00
|
|
|
before_action :authorize_read_board!, only: [:index, :show]
|
2017-08-28 21:56:49 +00:00
|
|
|
before_action :assign_endpoint_vars
|
2019-10-15 09:06:09 +00:00
|
|
|
before_action do
|
2019-11-14 12:06:30 +00:00
|
|
|
push_frontend_feature_flag(:multi_select_board, default_enabled: true)
|
2020-08-24 06:10:15 +00:00
|
|
|
push_frontend_feature_flag(:boards_with_swimlanes, project, default_enabled: false)
|
2019-10-15 09:06:09 +00:00
|
|
|
end
|
2016-08-08 22:03:41 +00:00
|
|
|
|
|
|
|
private
|
|
|
|
|
2017-08-28 21:56:49 +00:00
|
|
|
def assign_endpoint_vars
|
2017-12-03 18:46:07 +00:00
|
|
|
@boards_endpoint = project_boards_path(project)
|
2017-08-28 21:56:49 +00:00
|
|
|
@bulk_issues_path = bulk_update_project_issues_path(project)
|
2017-09-04 19:55:29 +00:00
|
|
|
@namespace_path = project.namespace.full_path
|
2017-08-28 21:56:49 +00:00
|
|
|
@labels_endpoint = project_labels_path(project)
|
|
|
|
end
|
|
|
|
|
2016-08-08 22:03:41 +00:00
|
|
|
def authorize_read_board!
|
2018-10-26 12:49:16 +00:00
|
|
|
access_denied! unless can?(current_user, :read_board, project)
|
2016-08-08 22:03:41 +00:00
|
|
|
end
|
2016-08-01 16:09:41 +00:00
|
|
|
end
|