Module: Authority::Abilities

Extended by:
ActiveSupport::Concern
Includes:
Definitions
Defined in:
lib/authority/abilities.rb

Overview

Should be included into all models in a Rails app. Provides the model with both class and instance methods like ‘updatable_by?(user)` Exactly which methods get defined is determined from `config.abilities`; the module is evaluated after any user-supplied config block is run in order to make that possible. All delegate to the methods of the same name on the model’s authorizer.

Defined Under Namespace

Modules: ClassMethods, Definitions

Instance Method Summary collapse

Instance Method Details

#authorizerObject



27
28
29
# File 'lib/authority/abilities.rb', line 27

def authorizer
  self.class.authorizer.new(self) # instantiate on every check, in case model has changed
end