diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-15 19:50:23 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-17 12:58:59 -0300 |
commit | cd98ff179cb20d9dc4460d173288d0e1582c4293 (patch) | |
tree | 5ec16f4ca84f95219d2b2a19c245532a7fab8254 /app/controllers/projects/boards_controller.rb | |
parent | c3880d105744dde1c8a30978e0cf13ebe017a91b (diff) | |
download | gitlab-ce-cd98ff179cb20d9dc4460d173288d0e1582c4293.tar.gz |
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.rb | 16 |
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 |