2020-01-01 13:55:28 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
2020-07-28 23:09:34 +05:30
|
|
|
class Pages < Grape::API::Instance
|
2020-01-01 13:55:28 +05:30
|
|
|
before do
|
|
|
|
require_pages_config_enabled!
|
|
|
|
authenticated_with_can_read_all_resources!
|
|
|
|
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-03-09 13:42:32 +05:30
|
|
|
|
|
|
|
no_content!
|
2020-01-01 13:55:28 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|