Class: LogicalAuthz::AccessControl::RemappedCriteria

Inherits:
Policy
  • Object
show all
Defined in:
lib/logical_authz/access_control.rb

Instance Attribute Summary

Attributes inherited from Policy

#decision, #name

Instance Method Summary collapse

Methods inherited from Policy

#evaluate, #laz_debug, names, register

Constructor Details

#initialize(other, &block) ⇒ RemappedCriteria

Returns a new instance of RemappedCriteria.



202
203
204
205
206
# File 'lib/logical_authz/access_control.rb', line 202

def initialize(other, &block)
  @other = other
  @block = block
  super()
end

Instance Method Details

#check(criteria) ⇒ Object



212
213
214
215
216
217
218
# File 'lib/logical_authz/access_control.rb', line 212

def check(criteria)
  new_criteria = criteria.dup
  laz_debug{ {:Remapping => new_criteria} }
  @block.call(new_criteria)
  laz_debug{ {:Remappped => new_criteria} }
  @other.check(new_criteria)
end

#default_nameObject



208
209
210
# File 'lib/logical_authz/access_control.rb', line 208

def default_name
  "Remapped: #{@other.default_name}"
end