Sha256: cbf1289c9d4dd39152d350fa81f1553190b2c367f4f63adfd2ab786055086c52
Contents?: true
Size: 918 Bytes
Versions: 15
Compression:
Stored size: 918 Bytes
Contents
# The AdminController is the parent class that makes sure all administrator actions # require a logged-in User with an admin Role. class Admin::BaseController < ApplicationController layout 'admin' # Replace this with your own authentication / authorization stuff before_filter :http_authentication # Example when using Devise gem # before_filter :authenticate_admin! # Add controller names you want to include as tab. Eg. # @@tabs = %w(messages) # if you created a Admin::MessagesController using the admin_scaffold generator. cattr_accessor :tabs @@tabs = %w() # GET /admin/ def index end private ADMIN_USERNAME = 'admin' # HTTP Basic admin username ADMIN_PASSWORD = 'admin' # HTTP Basic admin password def http_authentication authenticate_or_request_with_http_basic do |username, password| username == ADMIN_USERNAME && password == ADMIN_PASSWORD end end end
Version data entries
15 entries across 15 versions & 1 rubygems