Class: Arrthorizer::ContextRole

Inherits:
Role
  • Object
show all
Includes:
Singleton
Defined in:
lib/arrthorizer/context_role.rb

Direct Known Subclasses

Everybody, LoggedInUser, Nobody

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Role

#applies_to_user?, get, register, registry

Class Method Details

.applies_to_user?(*args) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/arrthorizer/context_role.rb', line 20

def self.applies_to_user?(*args)
  instance.applies_to_user?(*args)
end

.inherited(klass) ⇒ Object



24
25
26
27
28
# File 'lib/arrthorizer/context_role.rb', line 24

def self.inherited(klass)
  super

  Role.register(klass.instance)
end

.to_keyObject



16
17
18
# File 'lib/arrthorizer/context_role.rb', line 16

def self.to_key
  name
end

Instance Method Details

#to_keyObject



12
13
14
# File 'lib/arrthorizer/context_role.rb', line 12

def to_key
  self.class.to_key
end