module RoadForest::Augment::Affordance::GrantTokens

Public Instance Methods

each_grant_token(method, term) { |uri(join)| ... } click to toggle source
# File lib/roadforest/augment/affordance.rb, line 10
def each_grant_token(method, term)
  grant_route = term.router.mapped_route_for_name(term.route.name, :perm, {})
  term.resource.required_grants(method).each do |grant|
    grant_path = grant_route.build_path(:grant_name => grant)
    yield ::RDF::URI.new(canonical_uri.join(grant_path)) #XXX magical route name
  end
rescue KeyError
  term.resource.required_grants(method).each do |grant|
    yield grant
  end
end