lib/proxes/policies/request/search_policy.rb in proxes-0.2.0 vs lib/proxes/policies/request/search_policy.rb in proxes-0.3.0

- old
+ new

@@ -1,9 +1,9 @@ # frozen_string_literal: true module ProxES class Request - class SearchPolicy < ProxES::RequestPolicy - class Scope < ProxES::RequestPolicy::Scope + class SearchPolicy < RequestPolicy + class Scope < 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