388cb319d5
Partially addresses #47424.
22 lines
449 B
Ruby
22 lines
449 B
Ruby
# frozen_string_literal: true
|
|
|
|
module BlobViewer
|
|
class Readme < Base
|
|
include Auxiliary
|
|
include Static
|
|
|
|
self.partial_name = 'readme'
|
|
self.file_types = %i(readme)
|
|
self.binary = false
|
|
|
|
def visible_to?(current_user)
|
|
can?(current_user, :read_wiki, project)
|
|
end
|
|
|
|
def render_error
|
|
return if project.has_external_wiki? || (project.wiki_enabled? && project.wiki.has_home_page?)
|
|
|
|
:no_wiki
|
|
end
|
|
end
|
|
end
|