summaryrefslogtreecommitdiff
path: root/lib/api/group_boards.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/group_boards.rb')
-rw-r--r--lib/api/group_boards.rb34
1 files changed, 22 insertions, 12 deletions
diff --git a/lib/api/group_boards.rb b/lib/api/group_boards.rb
index 2bfd98a5b69..7425e1bd145 100644
--- a/lib/api/group_boards.rb
+++ b/lib/api/group_boards.rb
@@ -9,9 +9,7 @@ module API
feature_category :boards
- before do
- authenticate!
- end
+ before { authenticate! }
helpers do
def board_parent
@@ -22,28 +20,40 @@ module API
params do
requires :id, type: String, desc: 'The ID of a group'
end
-
resource :groups, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
segment ':id/boards' do
+ desc 'Get all group boards' do
+ detail 'This feature was introduced in 10.6'
+ success Entities::Board
+ end
+ params do
+ use :pagination
+ end
+ get '/' do
+ authorize!(:read_board, user_group)
+ present paginate(board_parent.boards.with_associations), with: Entities::Board
+ end
+
desc 'Find a group board' do
detail 'This feature was introduced in 10.6'
- success ::API::Entities::Board
+ success Entities::Board
end
get '/:board_id' do
authorize!(:read_board, user_group)
- present board, with: ::API::Entities::Board
+ present board, with: Entities::Board
end
- desc 'Get all group boards' do
- detail 'This feature was introduced in 10.6'
+ desc 'Update a group board' do
+ detail 'This feature was introduced in 11.0'
success Entities::Board
end
params do
- use :pagination
+ use :update_params
end
- get '/' do
- authorize!(:read_board, user_group)
- present paginate(board_parent.boards.with_associations), with: Entities::Board
+ put '/:board_id' do
+ authorize!(:admin_board, board_parent)
+
+ update_board
end
end