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