Class: Cms::SetupController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/generators/liquid_cms/templates/setup_controller.rb

Direct Known Subclasses

MainController

Instance Method Summary collapse

Instance Method Details

#authorize_role(role) ⇒ Object

Define your own authorization logic given one of the cms roles… :all, :cms_admin, :cms_user



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/generators/liquid_cms/templates/setup_controller.rb', line 12

def authorize_role(role)
  authorized = case role
  when :all, :cms_admin, :cms_user
    #current_user.present?
    true
  else
    false
  end

  redirect_to '/' unless authorized

  return authorized
end

#current_userObject

Returns the current user for the application. Remove this method if your application already defines a current_user method or provide valid code that returns a user object for the current user.



7
8
9
# File 'lib/generators/liquid_cms/templates/setup_controller.rb', line 7

def current_user
  nil
end