module Authorization
Constants
- AUTH_DSL_FILES
Public Class Methods
current_user()
click to toggle source
Controller-independent method for retrieving the current user. Needed for model security where the current controller is not available.
# File lib/declarative_authorization/authorization.rb, line 27 def self.current_user Thread.current["current_user"] || AnonymousUser.new end
current_user=(user)
click to toggle source
Controller-independent method for setting the current user.
# File lib/declarative_authorization/authorization.rb, line 32 def self.current_user=(user) Thread.current["current_user"] = user end
default_role()
click to toggle source
# File lib/declarative_authorization/authorization.rb, line 56 def self.default_role @@default_role end
default_role=(role)
click to toggle source
# File lib/declarative_authorization/authorization.rb, line 60 def self.default_role= (role) @@default_role = role.to_sym end
dot_path()
click to toggle source
# File lib/declarative_authorization/authorization.rb, line 47 def self.dot_path @@dot_path end
dot_path=(path)
click to toggle source
# File lib/declarative_authorization/authorization.rb, line 51 def self.dot_path= (path) @@dot_path = path end
is_a_association_proxy?(object)
click to toggle source
# File lib/declarative_authorization/authorization.rb, line 64 def self.is_a_association_proxy? (object) if Rails.version < "3.2" object.respond_to?(:proxy_reflection) else object.respond_to?(:proxy_association) end end