Module: Masks::Access

Extended by:
ActiveSupport::Concern
Included in:
ActorPassword, ActorScopes, ActorSignup
Defined in:
app/models/concerns/masks/access.rb,
app/models/masks/access/actor_scopes.rb,
app/models/masks/access/actor_signup.rb,
app/models/masks/access/actor_password.rb

Overview

Concern to help with building access classes.

Access classes must include this module, which will result in the class behaving like an ActiveModel instance, with attributes, validations, and json serialization available by default.

After including the module, classes must call access to register the class and its canonical name.

Examples:

class ExampleAccess
  include Masks::Access

  access 'example'

  def say_hi
    puts 'hello world!'
  end
end

# Later, this class can be accessed with a valid session,
# provided there is a corresponding mask that allows it.
access = Masks.access('example', session)
access.say_hi if access

See Also:

Defined Under Namespace

Modules: ClassMethods Classes: ActorPassword, ActorScopes, ActorSignup