Sha256: 479f0140560a2b9caf234e09f9aa88b05b2718cf5deab415bdf320046dcad0f0
Contents?: true
Size: 631 Bytes
Versions: 13
Compression:
Stored size: 631 Bytes
Contents
require 'singleton' ## # This is the superclass for all ContextRoles that the application may contain. # A ContextRole is a role that a User may or may not have, depending on the # current context. This can be things like 'the author of a certain post' or 'a # member of the current group' module Arrthorizer class ContextRole < Role include Singleton def to_key self.class.to_key end def self.to_key name end def self.applies_to_user?(*args) instance.applies_to_user?(*args) end def self.inherited(klass) super Role.register(klass.instance) end end end
Version data entries
13 entries across 13 versions & 1 rubygems