gitlab-org--gitlab-foss/app/models/blob_viewer
2020-04-30 18:09:38 +00:00
..
audio.rb Add latest changes from gitlab-org/gitlab@master 2019-10-16 15:06:17 +00:00
auxiliary.rb
balsamiq.rb
base.rb Avoid calling freeze on already frozen strings in app/models 2019-09-01 01:27:00 +05:30
binary_stl.rb
cargo_toml.rb Add latest changes from gitlab-org/gitlab@master 2019-12-18 12:07:48 +00:00
cartfile.rb
changelog.rb
client_side.rb
composer_json.rb
contributing.rb
dependency_manager.rb Add latest changes from gitlab-org/gitlab@master 2020-04-30 18:09:38 +00:00
download.rb
empty.rb
gemfile.rb
gemspec.rb
gitlab_ci_yml.rb Allow to include files from another projects 2019-01-07 09:38:05 +01:00
godeps_json.rb
image.rb Add latest changes from gitlab-org/gitlab@master 2019-09-23 18:06:14 +00:00
license.rb
markup.rb
notebook.rb
open_api.rb Add latest changes from gitlab-org/gitlab@master 2019-12-16 12:07:43 +00:00
package_json.rb Fix xss vulnerability sourced from package.json's homepage 2018-09-19 09:13:33 +08:00
pdf.rb
podfile.rb
podspec.rb
podspec_json.rb
readme.rb
requirements_txt.rb
rich.rb
route_map.rb
server_side.rb
simple.rb
sketch.rb
static.rb
svg.rb
text.rb
text_stl.rb
video.rb Add latest changes from gitlab-org/gitlab@master 2019-10-16 15:06:17 +00:00
yarn_lock.rb

# 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