Sha256: d1179344c9f300d784da7b1bd5dbbc533b00260ae586f4b4bc3593857b84b11d
Contents?: true
Size: 472 Bytes
Versions: 2
Compression:
Stored size: 472 Bytes
Contents
# frozen_string_literal: true module ProxES class Request class SearchPolicy < ProxES::RequestPolicy class Scope < ProxES::RequestPolicy::Scope def resolve patterns = ProxES::Permission.where(verb: 'INDEX', role: user.roles).map do |permission| permission.pattern.gsub(/\{user.(.*)\}/) { |match| user.send(Regexp.last_match[1].to_sym) } end filter scope.index, patterns end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
proxes-0.2.0 | lib/proxes/policies/request/search_policy.rb |
proxes-0.1.0 | lib/proxes/policies/request/search_policy.rb |