return [ 'type' =>
['administer comment types'
],
'uid' =>
['access user profiles'
],
];
} /**
* {@inheritdoc}
*/
public function testCollectionFilterAccess() { // Verify the expected behavior in the common case.
$this->
doTestCollectionFilterAccessForPublishableEntities('subject', 'access comments', 'administer comments'
);
$collection_url = Url::
fromRoute('jsonapi.entity_test--bar.collection'
);
$request_options =
[];
$request_options[RequestOptions::HEADERS
]['Accept'
] = 'application/vnd.api+json';
$request_options = NestedArray::
mergeDeep($request_options,
$this->
getAuthenticationRequestOptions());
// Go back to a simpler scenario: revoke the admin permission, publish the
// comment and uninstall the query access test module.
$this->
revokePermissionsFromTestedRole(['administer comments'
]);
$this->entity->
setPublished()->
save();
$this->
assertTrue($this->container->
get('module_installer'
)->
uninstall(['jsonapi_test_field_filter_access'
], TRUE
), 'Uninstalled modules.'
);