Add field and entity access check on `ApiAutoSaveController::post()`

Created on 10 June 2025, 14 days ago

Overview

Forked from #3494915-45: Support entity-level + field-level access checking in auto-save β€” i.e. in `experience_builder.api.api.(layout.post|auto-save.post)` β†’ .

Add field and entity access check on `ApiAutoSaveController::post()`

Proposed resolution

  • Update `ApiAutoSaveController::post()`, which must:
    • Iterate over all content + config entities in the auto-save store
    • throw a CacheableAccessDeniedHttpException if any of them fail on $entity->access(operation: 'update', return_as_object: TRUE)
    • if a content entity, iterate over all changed fields, throw a CacheableAccessDeniedHttpException if any of them fail on $entity->get($field_name)->access(operation: 'edit', return_as_object: TRUE).
  • Update `\Drupal\Tests\experience_builder\Kernel\ApiAutoSaveControllerTest::testApiAutoSaveControllerPost`

User interface changes

None.

πŸ“Œ Task
Status

Active

Version

0.0

Component

Auto-save

Created by

πŸ‡ͺπŸ‡ΈSpain penyaskito Seville πŸ’ƒ, Spain πŸ‡ͺπŸ‡Έ, UTC+2 πŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024