Sha256: 76690811949eb7ae03d0c20127384571e15603280b15da197a76480a19ff879f
Contents?: true
Size: 471 Bytes
Versions: 2
Compression:
Stored size: 471 Bytes
Contents
# frozen_string_literal: true module ProxES class Request class StatsPolicy < 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/stats_policy.rb |
proxes-0.1.0 | lib/proxes/policies/request/stats_policy.rb |