Sha256: cfce02ec6ddd66c2b0e695ea46c5d5ec9beaf87ba0d140dbe52ac7c5063fb876

Contents?: true

Size: 721 Bytes

Versions: 29

Compression:

Stored size: 721 Bytes

Contents

class Cms::SetupController < ApplicationController
  # filters and other customizations can be made here before the cms controllers are run

  # 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.
  def current_user
    @company.users.first
  end

  # Define your own authorization logic given one of the cms roles... :all, :cms_admin, :cms_user
  def authorize_role(role)
    authorized = case role
    when :all, :cms_admin, :cms_user
      current_user.present?
    else
      false
    end

    redirect_to '/login' unless authorized

    return authorized
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
liquid_cms-0.3.2.0 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.2.2.0 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.2.1.1 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.3.1.0 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.2.1.0 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.2.0.13 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.3.0.10 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.3.0.9 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.2.0.12 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.2.0.11 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.2.0.10 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.3.0.8 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.2.0.9 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.3.0.7 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.3.0.6 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.2.0.8 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.3.0.5 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.2.0.7 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.3.0.4 test/rails_app/app/controllers/cms/setup_controller.rb
liquid_cms-0.2.0.6 test/rails_app/app/controllers/cms/setup_controller.rb