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
# File 'app/controllers/lolita/info_controller.rb', line 5

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

#is_lolita_resource?Boolean

Returns:

  • (Boolean)


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

def is_lolita_resource?
  true
end

#propertiesObject



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

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