Module: ActiveScaffold::ActiveRecordPermissions::ModelUserAccess::Model::ClassMethods

Defined in:
lib/active_scaffold/active_record_permissions.rb

Instance Method Summary collapse

Instance Method Details

#current_userObject

Class-level access to the current user



58
59
60
# File 'lib/active_scaffold/active_record_permissions.rb', line 58

def current_user
  ActiveRecord::Base.current_user_proc.call if ActiveRecord::Base.current_user_proc
end

#current_user_procObject

The proc to call that retrieves the current_user from the ApplicationController.



50
51
52
# File 'lib/active_scaffold/active_record_permissions.rb', line 50

def current_user_proc
  Thread.current[:current_user_proc]
end

#current_user_proc=(proc_value) ⇒ Object



53
54
55
# File 'lib/active_scaffold/active_record_permissions.rb', line 53

def current_user_proc=(proc_value)
  Thread.current[:current_user_proc] = proc_value
end