Sha256: 109dd5bc5720770d25d6e8ab66b8e75aec6a37e243977a8d86d20d8be043db22
Contents?: true
Size: 692 Bytes
Versions: 92
Compression:
Stored size: 692 Bytes
Contents
require 'set' require 'active_model/mass_assignment_security/sanitizer' module ActiveModel module MassAssignmentSecurity class PermissionSet < Set attr_accessor :logger def +(values) super(values.map(&:to_s)) end def include?(key) super(remove_multiparameter_id(key)) end protected def remove_multiparameter_id(key) key.to_s.gsub(/\(.+/, '') end end class WhiteList < PermissionSet include Sanitizer def deny?(key) !include?(key) end end class BlackList < PermissionSet include Sanitizer def deny?(key) include?(key) end end end end
Version data entries
92 entries across 92 versions & 2 rubygems