gitlab-org--gitlab-foss/app/models/blob_viewer
Matija Čupić 1e816a9721
Address MR suggestions
CE mirror of c4578b951e331fe8c75cd4f948ce74cec6587bad
2018-09-07 22:22:52 +02:00
..
auxiliary.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
balsamiq.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
base.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
binary_stl.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
cartfile.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
changelog.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
client_side.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
composer_json.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
contributing.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
dependency_manager.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
download.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
empty.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
gemfile.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
gemspec.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
gitlab_ci_yml.rb Address MR suggestions 2018-09-07 22:22:52 +02:00
godeps_json.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
image.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
license.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
markup.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
notebook.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
package_json.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
pdf.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
podfile.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
podspec.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
podspec_json.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
readme.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
requirements_txt.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
rich.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
route_map.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
server_side.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
simple.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
sketch.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
static.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
svg.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
text.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
text_stl.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
video.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00
yarn_lock.rb Enable frozen string for app/models/**/*.rb 2018-08-03 01:44:16 -07:00

# 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