Sha256: 53e4597a76239b80159f35ee8014159d830b8c29581323f222451441528b9299

Contents?: true

Size: 594 Bytes

Versions: 2

Compression:

Stored size: 594 Bytes

Contents

class Smithy::BaseController < ApplicationController
  layout 'smithy/application'

  before_filter :authenticate_smithy_admin

  private

    def authenticate_smithy_admin
      unless smithy_current_user && smithy_current_user.smithy_admin?
        flash.alert = "Please login to continue."
        redirect_to smithy_login_path
      end
    end

    def filtered_params
      permitted_params.params_for controller_name.singularize
    end

    def permitted_params
      permitted_params ||= PermittedParams.new(params, smithy_current_user)
    end
    helper_method :permitted_params
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
smithycms-0.4.1 app/controllers/smithy/base_controller.rb
smithycms-0.4.0 app/controllers/smithy/base_controller.rb