debian-mirror-gitlab/lib/api/helpers/project_snapshots_helpers.rb

30 lines
692 B
Ruby
Raw Normal View History

2018-12-05 23:21:45 +05:30
# frozen_string_literal: true
2018-05-09 12:01:36 +05:30
module API
module Helpers
module ProjectSnapshotsHelpers
2019-12-04 20:38:33 +05:30
prepend_if_ee('::EE::API::Helpers::ProjectSnapshotsHelpers') # rubocop: disable Cop/InjectEnterpriseEditionModule
2018-05-09 12:01:36 +05:30
def authorize_read_git_snapshot!
2020-01-01 13:55:28 +05:30
authenticated_with_can_read_all_resources!
2018-05-09 12:01:36 +05:30
end
def send_git_snapshot(repository)
header(*Gitlab::Workhorse.send_git_snapshot(repository))
end
def snapshot_project
user_project
end
def snapshot_repository
if to_boolean(params[:wiki])
snapshot_project.wiki.repository
else
snapshot_project.repository
end
end
end
end
end