debian-mirror-gitlab/app/controllers/projects/repositories_controller.rb

20 lines
544 B
Ruby
Raw Normal View History

2014-09-02 18:07:02 +05:30
class Projects::RepositoriesController < Projects::ApplicationController
# Authorize
2015-09-11 14:41:01 +05:30
before_action :require_non_empty_project, except: :create
before_action :authorize_download_code!
before_action :authorize_admin_project!, only: :create
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
def create
@project.create_repository
redirect_to project_path(@project)
2014-09-02 18:07:02 +05:30
end
def archive
2015-10-24 18:46:33 +05:30
render json: ArchiveRepositoryService.new(@project, params[:ref], params[:format]).execute
rescue => ex
logger.error("#{self.class.name}: #{ex}")
return git_not_found!
2014-09-02 18:07:02 +05:30
end
end