lib/proxes/policies/request/bulk_policy.rb in proxes-0.8.3 vs lib/proxes/policies/request/bulk_policy.rb in proxes-0.8.4

- old
+ new

@@ -11,12 +11,13 @@ patterns = Permission.for_user(user, 'INDEX').map do |permission| permission.pattern.gsub(/\{user.(.*)\}/) { |_match| user.send(Regexp.last_match[1].to_sym) } end return false if request.index && !index_allowed? + return false if request.bulk_indices == '' || patterns.empty? patterns.find do |pattern| - request.bulk_indices.find { |idx| idx !~ /#{pattern}/} + request.bulk_indices.find { |idx| idx !~ /#{pattern}/ } end.nil? end class Scope < RequestPolicy::Scope def resolve