$request_options =
[];
$request_options[RequestOptions::HEADERS
]['Accept'
] = 'application/vnd.api+json';
$request_options = NestedArray::
mergeDeep($request_options,
$this->
getAuthenticationRequestOptions());
// Test GET.
$this->
doTestRelationshipGet($request_options);
$this->
setUpAuthorization('GET'
);
$this->
doTestRelationshipGet($request_options);
// Test POST.
$this->
config('jsonapi.settings'
)->
set('read_only', FALSE
)->
save(TRUE
);
$this->
doTestRelationshipMutation($request_options);
// Grant entity-level edit access.
$this->
setUpAuthorization('PATCH'
);
$this->
doTestRelationshipMutation($request_options);
// Field edit access is still forbidden, grant it.
$this->
grantPermissionsToTestedRole([ 'field_jsonapi_test_entity_ref view access',
'field_jsonapi_test_entity_ref edit access',
'field_jsonapi_test_entity_ref update access',
]);
$this->
doTestRelationshipMutation($request_options);
}