Class: ProxES::Request::BulkPolicy

Inherits:
ProxES::RequestPolicy show all
Defined in:
lib/proxes/policies/request/bulk_policy.rb

Defined Under Namespace

Classes: Scope

Instance Attribute Summary

Attributes inherited from ProxES::RequestPolicy

#record, #user

Instance Method Summary collapse

Methods inherited from ProxES::RequestPolicy

#action_allowed?, #index_allowed?, #initialize, #method_missing, #respond_to_missing?

Methods included from Helpers::Indices

#filter, #patterns, #patterns_for

Constructor Details

This class inherits a constructor from ProxES::RequestPolicy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ProxES::RequestPolicy

Instance Method Details

#post?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
17
18
# File 'lib/proxes/policies/request/bulk_policy.rb', line 10

def post?
  return false if user.nil? ||
                  (request.index && !index_allowed?) ||
                  (request.bulk_indices == '' || patterns.blank?)

  patterns.find do |pattern|
    request.bulk_indices.find { |idx| idx !~ /#{pattern}/ }
  end.nil?
end