function ItemResourceTestBase::getExpectedUnauthorizedAccessMessage

Same name in other branches
  1. 9 core/modules/aggregator/tests/src/Functional/Rest/ItemResourceTestBase.php \Drupal\Tests\aggregator\Functional\Rest\ItemResourceTestBase::getExpectedUnauthorizedAccessMessage()

Overrides EntityResourceTestBase::getExpectedUnauthorizedAccessMessage

File

core/modules/aggregator/tests/src/Functional/Rest/ItemResourceTestBase.php, line 173

Class

ItemResourceTestBase
ResourceTestBase for Item entity.

Namespace

Drupal\Tests\aggregator\Functional\Rest

Code

protected function getExpectedUnauthorizedAccessMessage($method) {
    if ($this->config('rest.settings')
        ->get('bc_entity_resource_permissions')) {
        return parent::getExpectedUnauthorizedAccessMessage($method);
    }
    switch ($method) {
        case 'GET':
            return "The 'access news feeds' permission is required.";
        case 'POST':
        case 'PATCH':
        case 'DELETE':
            return "The 'administer news feeds' permission is required.";
        default:
            return parent::getExpectedUnauthorizedAccessMessage($method);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.