# Include require 'rubygems' require 'active_support' require 'role_based_security/model_additions' require 'role_based_security/controller_additions' require 'role_based_security/view_additions' # = RoleBasedSecurity # module RoleBasedSecurity # ::Rails.logger.error("...") # default options that can be overridden on the global level @@options = { :home_path => '/welcome', # :locale_message_key => 'labels.invalid_rights', # :invalid_rights_message => 'Sorry, but you don\'t have access rights to visit this URL', # } mattr_reader :options def self.enable_activerecord ActiveRecord::Base.send :include, RoleBasedSecurity::ModelAdditions end def self.enable_actionpack ActionController::Base.send :include, RoleBasedSecurity::ControllerAdditions ActionController::Base.send :extend, RoleBasedSecurity::ControllerAdditions::ClassMethods ActionView::Base.send :include, RoleBasedSecurity::ViewAdditions end end if defined? Rails RoleBasedSecurity.enable_activerecord if defined? ActiveRecord RoleBasedSecurity.enable_actionpack if defined? ActionController end