lib/opro.rb in opro-0.0.1.pre1.0.2 vs lib/opro.rb in opro-0.0.1

- old
+ new

@@ -1,9 +1,11 @@ module Opro - module Controllers + module Concerns + end end + # Include helpers in the given scope to AC and AV. def self.include_helpers(scope) ActiveSupport.on_load(:action_controller) do include scope::ApplicationControllerHelper if defined?(scope::ApplicationControllerHelper) end @@ -37,11 +39,11 @@ def self.logout(*args) raise 'login method not set, please specify Opro auth_strategy' if login_method.blank? logout_method.call(*args) end - + # Used by set_login_logout_methods to pre-define login, logout, and authenticate methods def self.auth_strategy(auth_strategy = nil) if auth_strategy.present? @auth_strategy = auth_strategy else @auth_strategy @@ -59,11 +61,19 @@ else @login_method or raise 'login method not set, please specify Opro auth_strategy' end end + def self.request_permissions=(permissions) + @request_permissions = permissions + end + def self.request_permissions + @request_permissions || [] + end + + def self.logout_method(&block) if block.present? @logout_method = block else @logout_method or raise 'login method not set, please specify Opro auth_strategy' @@ -77,10 +87,9 @@ @authenticate_user_method or raise 'authenticate user method not set, please specify Opro auth_strategy' end end end -# require 'opro/controller/concerns/render_redirect' -# require 'opro/controller/concerns/steps' -# require 'opro/controller/concerns/path' +require 'opro/controllers/concerns/error_messages' +require 'opro/controllers/concerns/permissions' require 'opro/controllers/application_controller_helper' require 'opro/engine'