You are here

protected function ApiProductRoleBasedAccessTestBase::messageIfUserShouldNotHaveAccess in Apigee Edge 8

Error message, when a user should not have access to an API product.

Parameters

string $operation: Operation on API product.

\Drupal\user\UserInterface $user: User object.

string $user_rid: Currently tested role of the user.

array $rids_with_access: Roles with access to the API product.

\Drupal\apigee_edge\Entity\ApiProductInterface $product: API Product.

Return value

string Error message.

Overrides ApiProductAccessTest::messageIfUserShouldNotHaveAccess

File

modules/apigee_edge_apiproduct_rbac/tests/src/FunctionalJavascript/ApiProductRoleBasedAccessTestBase.php, line 112

Class

ApiProductRoleBasedAccessTestBase
Base calls for validating role based access control on API products.

Namespace

Drupal\Tests\apigee_edge_apiproduct_rbac\FunctionalJavascript

Code

protected function messageIfUserShouldNotHaveAccess(string $operation, UserInterface $user, string $user_rid, array $rids_with_access, ApiProductInterface $product) : string {
  return sprintf('"%s" user without "Bypass API Product access control" permission should not have "%s" access to this API Product. RBAC attribute value: "%s". Roles with access granted: %s.', $user_rid, $operation, $product
    ->getAttributeValue($this->rbacAttributeName), implode(', ', $rids_with_access));
}