2019-12-09 09:08:00 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
class Pages < Grape::API
|
|
|
|
before do
|
|
|
|
require_pages_config_enabled!
|
2019-12-17 09:07:48 +00:00
|
|
|
authenticated_with_can_read_all_resources!
|
2019-12-09 09:08:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
params do
|
|
|
|
requires :id, type: String, desc: 'The ID of a project'
|
|
|
|
end
|
|
|
|
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
|
|
|
|
desc 'Unpublish pages' do
|
|
|
|
detail 'This feature was introduced in GitLab 12.6'
|
|
|
|
end
|
|
|
|
delete ':id/pages' do
|
|
|
|
authorize! :remove_pages, user_project
|
|
|
|
|
|
|
|
::Pages::DeleteService.new(user_project, current_user).execute
|
2020-01-16 18:08:46 +00:00
|
|
|
|
|
|
|
no_content!
|
2019-12-09 09:08:00 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|