Sha256: 0e08782f4b07859ed272fdefc5982947c5127df28a8c082880a065ce93ef8f42

Contents?: true

Size: 434 Bytes

Versions: 9

Compression:

Stored size: 434 Bytes

Contents

# frozen_string_literal: true

module ProxES
  class Request
    class StatsPolicy < RequestPolicy
      class Scope < RequestPolicy::Scope
        def resolve
          patterns = Permission.for_user(user, 'INDEX').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

9 entries across 9 versions & 1 rubygems

Version Path
proxes-0.6.1 lib/proxes/policies/request/stats_policy.rb
proxes-0.6.0 lib/proxes/policies/request/stats_policy.rb
proxes-0.5.2 lib/proxes/policies/request/stats_policy.rb
proxes-0.5.1 lib/proxes/policies/request/stats_policy.rb
proxes-0.5.0 lib/proxes/policies/request/stats_policy.rb
proxes-0.4.4 lib/proxes/policies/request/stats_policy.rb
proxes-0.4.3 lib/proxes/policies/request/stats_policy.rb
proxes-0.4.2 lib/proxes/policies/request/stats_policy.rb
proxes-0.4.1 lib/proxes/policies/request/stats_policy.rb