You are here

protected function TeamApiProductAccessTest::changeTeamApiProductAccess in Apigee Edge 8

Changes team API product access settings.

Parameters

bool|null $public: Grant access to view public API products. NULL means do not change current settings.

bool|null $private: Grant access to view private API products. NULL means do not change current settings.

bool|null $internal: Grant access to view internal API products. NULL means do not change current settings.

1 call to TeamApiProductAccessTest::changeTeamApiProductAccess()
TeamApiProductAccessTest::setUp in modules/apigee_edge_teams/tests/src/Functional/TeamApiProductAccessTest.php

File

modules/apigee_edge_teams/tests/src/Functional/TeamApiProductAccessTest.php, line 316

Class

TeamApiProductAccessTest
Team-level API product access test.

Namespace

Drupal\Tests\apigee_edge_teams\Functional

Code

protected function changeTeamApiProductAccess(?bool $public, ?bool $private, ?bool $internal) : void {
  $rm = new \ReflectionMethod($this, __FUNCTION__);
  $permissions = [];
  foreach ($rm
    ->getParameters() as $parameter) {
    $parameter_value = ${$parameter
      ->getName()};
    if ($parameter_value !== NULL) {
      $permissions["api_product_access_{$parameter->getName()}"] = $parameter_value;
    }
  }
  if (!empty($permissions)) {
    $this->teamRoleStorage
      ->changePermissions(TeamRoleInterface::TEAM_MEMBER_ROLE, $permissions);
  }
}