class Tuersteher::RightSpecification

Attributes

negation[R]
rights[R]

Public Class Methods

new(right, negation) click to toggle source
# File lib/tuersteher.rb, line 468
def initialize right, negation
  @negation = negation
  @rights = [right]
end

Public Instance Methods

grant?(path_or_model, method, login_ctx) click to toggle source
# File lib/tuersteher.rb, line 473
def grant? path_or_model, method, login_ctx
  return false if login_ctx.nil?
  rc =@rights.any?{|right| login_ctx.has_right?(right) }
  rc = !rc if @negation
  rc
end
to_s() click to toggle source
# File lib/tuersteher.rb, line 480
def to_s
  "#{@negation && 'not.'}rights(#{@rights.join(',')})"
end