You are here

protected function TeamAppEditForm::canEditApiProducts in Apigee Edge 8

Access check for editing API products.

Return value

bool TRUE if current user can edit API products. FALSE otherwise.

Overrides AppEditForm::canEditApiProducts

File

modules/apigee_edge_teams/src/Entity/Form/TeamAppEditForm.php, line 120

Class

TeamAppEditForm
General form handler for the team app edit.

Namespace

Drupal\apigee_edge_teams\Entity\Form

Code

protected function canEditApiProducts() : bool {
  if (($team_name = $this->entity
    ->getAppOwner()) && ($team = $this->entityTypeManager
    ->getStorage('team')
    ->load($team_name))) {
    return in_array('team_app_edit_api_products', $this->teamPermissionHandler
      ->getDeveloperPermissionsByTeam($team, $this
      ->currentUser()));
  }
  return parent::canEditApiProducts();
}