Class: Cms::SetupController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Cms::SetupController
- Defined in:
- lib/generators/liquid_cms/templates/setup_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#authorize_role(role) ⇒ Object
Define your own authorization logic given one of the cms roles…
-
#current_user ⇒ Object
Returns the current user for the application.
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 (role) = case role when :all, :cms_admin, :cms_user #current_user.present? true else false end redirect_to '/' unless return end |
#current_user ⇒ Object
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 |