Drupal 8.9.11
Image File Uploaded via REST gets "status - Temporary" while setting explicitly "status" case to True server error 403 (code in python)
"status": [
{
"value": True
}
],
The sever returns code 403, an exception:
Status: 403, Message: {"message":"Access denied on creating field \u0027status\u0027."}
The error on the server: $ vendor/bin/drush watchdog-show
access denied Warning Path: /themag_dp8/entity/file?_format=hal_json.
Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException: Access denied on creating
field 'status'. in Drupal\rest\Plugin\rest\resou
If I'll not specify "status = true" The next REST call to Create Media fails to reference it due to its temporary status.
payload = {
"name": {
"value": name
},
"field_image": [
{
"target_id": file_id
}
],
"field_description": [
{
"value": description
},
],
"bundle": [
{
"target_id": "image"
}
],
"_links": {
"type": {
"href": oauth.base_url + REST_TYPE_MEDIA_IMAGE
},
oauth.base_url + "/rest/relation/media/image/thumbnail": [
{
"href": oauth.base_url + "/file/%d" % file_id + FORMAT_HAL_JSON
}
],
oauth.base_url + "/rest/relation/media/image/field_image": [
{
"href": oauth.base_url + "/file/%d" % file_id + FORMAT_HAL_JSON
}
]
}
}
Status: 422, Message: {"message":"Unprocessable Entity: validation failed.\nfield_image.0.target_id:
This entity (file: 119) cannot be referenced.\n"}
Server error: $ vendor/bin/drush watchdog-show
access denied Warning
Path: /themag_dp8/entity/paragraph?_format=hal_json.
Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException: in
Drupal\Core\Routing\AccessAwareRouter->checkAccess() (line 120 of
php Error
Symfony\Component\HttpKernel\Exception\UnprocessableEntityHttpException: Unprocessable Entity:
validation failed.
field_image.0.target_id: This entity (file: 119) cannot be referenced.
in
When I manually, via web site admin (https://drupal8.site/admin/content/files), change the file status to "Permanent", this Create Media REST call succeeds to create a new media/image entity.
Seems the Rest user missing some security allowances, but which one? Did anybody succeed to create a node consisting of the teaser image, paragraph video and so?
Sure I'm not the first who attack this issue, where the relevant documentation, working code examples?