Sha256: ed67d5efdc3b7a5cc0f95c7f917ad9c2e3ed67845f4548ad2574cc46e77d02ec

Contents?: true

Size: 624 Bytes

Versions: 1

Compression:

Stored size: 624 Bytes

Contents

module Phcpresspro
  class ApplicationController < ActionController::Base

    # Security Filters
    protect_from_forgery with: :exception

    # Load Helpers
    helper Phctitleseo::Engine.helpers
    helper Phcnotifi::Engine.helpers
    helper Phcaccountspro::Engine.helpers

    # Papertrail Whodunnit Username
    def user_for_paper_trail
      current_user ? current_user.username : 'Public user'
    end

    private

    # Add Admin Only Filter
    def phc_accounts_pro_admin_only
      unless current_user.admin?
        redirect_to main_app.root_path, :alert => "Sorry Access denied."
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
phcpresspro-80.0.0 app/controllers/phcpresspro/application_controller.rb