You are here

protected function ApiProductAccessTest::getRolesWithAccess in Apigee Edge 8

Returns roles (role ids) with access to an API product.

Parameters

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

Return value

array Array of role ids.

1 call to ApiProductAccessTest::getRolesWithAccess()
ApiProductAccessTest::entityAccessTest in tests/src/FunctionalJavascript/ApiProductAccessTest.php
Tests "Access by visibility" access control.
1 method overrides ApiProductAccessTest::getRolesWithAccess()
ApiProductRoleBasedAccessTestBase::getRolesWithAccess in modules/apigee_edge_apiproduct_rbac/tests/src/FunctionalJavascript/ApiProductRoleBasedAccessTestBase.php
Returns roles (role ids) with access to an API product.

File

tests/src/FunctionalJavascript/ApiProductAccessTest.php, line 431

Class

ApiProductAccessTest
Validates built-in access control on API products.

Namespace

Drupal\Tests\apigee_edge\FunctionalJavascript

Code

protected function getRolesWithAccess(ApiProductInterface $product) : array {
  $prodVisibility = $product
    ->getAttributeValue('access');
  return $this
    ->config('apigee_edge.api_product_settings')
    ->get('access')[$prodVisibility] ?? [];
}