Module: TwoPercent::ValidatesUserGroupsPatch
- Included in:
- BulkProcessor, ScimController
- Defined in:
- lib/two_percent/validates_user_groups_patch.rb
Overview
Validates PATCH operations against RFC 7643 read-only attributes
Ensures User.groups attribute cannot be modified via PATCH operations, as per RFC 7643 Section 4.1.2. Group memberships must be managed via PATCH operations on the Group resource itself.
Instance Method Summary collapse
-
#validate_patch_operations!(resource_type, patch_request) ⇒ Object
Validate PATCH operations against RFC 7643 read-only attributes.
Instance Method Details
#validate_patch_operations!(resource_type, patch_request) ⇒ Object
Validate PATCH operations against RFC 7643 read-only attributes
14 15 16 17 18 19 20 21 22 |
# File 'lib/two_percent/validates_user_groups_patch.rb', line 14 def validate_patch_operations!(resource_type, patch_request) return unless resource_type == "Users" patch_request = patch_request.with_indifferent_access operations = patch_request[:Operations] return unless operations.is_a?(Array) operations.each { |operation| validate_operation_path!(operation.with_indifferent_access) } end |