Module: ActiveScaffold::ActiveRecordPermissions::Permissions

Defined in:
lib/active_scaffold/active_record_permissions.rb

Defined Under Namespace

Modules: SecurityMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object


65
66
67
68
69
70
71
72
# File 'lib/active_scaffold/active_record_permissions.rb', line 65

def self.included(base)
  base.extend SecurityMethods
  base.send :include, SecurityMethods
  class << base
    attr_accessor :class_security_methods
    attr_accessor :instance_security_methods
  end
end

Instance Method Details

#existing_record_check?Boolean

Because any class-level queries get delegated to the instance level via a new record, it's useful to know when the authorization query is meant for a specific record or not. But using new_record? is confusing, even though accurate. So this is basically just a wrapper.

Returns:

  • (Boolean)

77
78
79
# File 'lib/active_scaffold/active_record_permissions.rb', line 77

def existing_record_check?
  !new_record?
end