'DELETE' => "The 'delete any file' permission is required.",
default => parent::
getExpectedUnauthorizedAccessMessage($method),
};
} /**
* {@inheritdoc}
*/
public function testCollectionFilterAccess() { $label_field_name = 'filename';
// Verify the expected behavior in the common case: when the file is public.
$this->
doTestCollectionFilterAccessBasedOnPermissions($label_field_name, 'access content'
);
$collection_url = Url::
fromRoute('jsonapi.entity_test--bar.collection'
);
$collection_filter_url =
$collection_url->
setOption('query',
["filter[spotlight.
$label_field_name]" =>
$this->entity->
label()]);
$request_options =
[];
$request_options[RequestOptions::HEADERS
]['Accept'
] = 'application/vnd.api+json';
$request_options = NestedArray::
mergeDeep($request_options,
$this->
getAuthenticationRequestOptions());
// 1 result because the current user is the file owner, even though the file
// is private.
$this->entity->
setFileUri('private://drupal.txt'
);
$this->entity->
setOwner($this->account
);