Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-16 01:50:23 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-17 18:58:59 +0300
commitcd98ff179cb20d9dc4460d173288d0e1582c4293 (patch)
tree5ec16f4ca84f95219d2b2a19c245532a7fab8254 /app/controllers/projects/boards_controller.rb
parentc3880d105744dde1c8a30978e0cf13ebe017a91b (diff)
Move action to render board lists to `Projects::Boards::ListsController`
Diffstat (limited to 'app/controllers/projects/boards_controller.rb')
-rw-r--r--app/controllers/projects/boards_controller.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/app/controllers/projects/boards_controller.rb b/app/controllers/projects/boards_controller.rb
index 052c15f99d0..33206717089 100644
--- a/app/controllers/projects/boards_controller.rb
+++ b/app/controllers/projects/boards_controller.rb
@@ -1,23 +1,15 @@
class Projects::BoardsController < Projects::ApplicationController
+ respond_to :html
+
before_action :authorize_read_board!, only: [:show]
def show
- board = Boards::CreateService.new(project, current_user).execute
-
- respond_to do |format|
- format.html
- format.json { render json: board.lists.as_json(only: [:id, :list_type, :position], methods: [:title], include: { label: { only: [:id, :title, :description, :color, :priority] } }) }
- end
+ ::Boards::CreateService.new(project, current_user).execute
end
private
def authorize_read_board!
- unless can?(current_user, :read_board, project)
- respond_to do |format|
- format.html { return access_denied! }
- format.json { return render_403 }
- end
- end
+ return access_denied! unless can?(current_user, :read_board, project)
end
end