Class: BlobViewer::Readme

Inherits:
Base
  • Object
show all
Includes:
Auxiliary, Static
Defined in:
app/models/blob_viewer/readme.rb

Constant Summary

Constants inherited from Base

Base::PARTIAL_PATH_PREFIX

Instance Attribute Summary

Attributes inherited from Base

#blob

Instance Method Summary collapse

Methods included from Gitlab::Allowable

#can?

Methods inherited from Base

auxiliary?, binary?, #binary_detected_after_load?, can_render?, #collapsed?, #initialize, load_async?, loading_partial_path, partial_path, #prepare!, rich?, simple?, text?, #too_large?

Constructor Details

This class inherits a constructor from BlobViewer::Base

Instance Method Details

#render_errorObject



16
17
18
19
20
# File 'app/models/blob_viewer/readme.rb', line 16

def render_error
  return if project.has_external_wiki? || (project.wiki_enabled? && project.wiki.has_home_page?)

  :no_wiki
end

#visible_to?(current_user) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/models/blob_viewer/readme.rb', line 12

def visible_to?(current_user)
  can?(current_user, :read_wiki, project)
end