gitlab-org--gitlab-foss/app/models/blob_viewer/readme.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
449 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-05-14 15:01:12 -04:00
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
2017-05-14 15:01:12 -04:00
end
end