Class: Lolita::InfoController

Inherits:
ApplicationController
  • Object
show all
Includes:
Controllers::AuthenticationHelpers
Defined in:
app/controllers/lolita/info_controller.rb

Constant Summary collapse

@@properties =
[]

Instance Method Summary collapse

Methods included from Controllers::AuthenticationHelpers

#authenticate_lolita_user!

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/lolita/info_controller.rb', line 5

def index
  if Lolita.mappings.any?
    available_mapping = Lolita.mappings.detect{|name,mapping|
      authorization_proxy.can?(:read,mapping.to)
    }
    available_mapping &&= available_mapping.last
    return redirect_to(lolita_resources_path(available_mapping)) if available_mapping
  end
  render :layout => false
end

#is_lolita_resource?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'app/controllers/lolita/info_controller.rb', line 24

def is_lolita_resource?
  true
end

#propertiesObject



16
17
18
19
20
21
22
# File 'app/controllers/lolita/info_controller.rb', line 16

def properties
  if request.local?
    render :inline => to_html
  else
    render :text => '<p>For security purposes, this information is only available to local requests.</p>', :status => :forbidden
  end
end