debian-mirror-gitlab/app/models/blob_viewer/readme.rb

21 lines
418 B
Ruby
Raw Normal View History

2017-09-10 17:25:29 +05:30
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