public function enrollManageAccess(AccountInterface $account) {
    if (AccessResult::allowedIfHasPermission($account, 'manage all enrollments')->isAllowed()) {
      return AccessResult::allowed();
    }
    else {
      /** @var \Drupal\node\Entity\Node $node */
      $node = $this->routeMatch->getParameter('node');
      if (!is_null($node) && (!is_object($node))) {
        $node = $this->entityTypeManager
          ->getStorage('node')
          ->load($node);
      }
      if ($node instanceof NodeInterface) {
        return SocialEventManagersAccessHelper::getEntityAccessResult($node, 'update', $account);
      }
    }
    return AccessResult::forbidden();
  }
public function enrollManageAccess(AccountInterface $account) {
    if (AccessResult::allowedIfHasPermission($account, 'manage all enrollments')->isAllowed()) {
      return AccessResult::allowed();
    }
    else {
      /** @var \Drupal\node\Entity\Node $node */
      $node = $this->routeMatch->getParameter('node');
      if (!is_null($node) && (!is_object($node))) {
        $node = $this->entityTypeManager
          ->getStorage('node')
          ->load($node);
      }
      if ($node instanceof NodeInterface) {
        return SocialEventManagersAccessHelper::getEntityAccessResult($node, 'update', $account);
      }
    }
    return AccessResult::forbidden();
  }
public function enrollManageAccess ( AccountInterface $ account ) { if ( AccessResult :: allowedIfHasPermission ( $ account , 'manage all enrollments' ) -> isAllowed ( ) ) { return AccessResult :: allowed ( ) ; } else { /** @var \Drupal\node\Entity\Node $node */ $ node = $ this -> routeMatch -> getParameter ( 'node' ) ; if ( ! is_null ( $ node ) && ( ! is_object ( $ node ) ) ) { $ node = $ this -> entityTypeManager -> getStorage ( 'node' ) -> load ( $ node ) ; } if ( $ node instanceof NodeInterface ) { return SocialEventManagersAccessHelper :: getEntityAccessResult ( $ node , 'update' , $ account ) ; } } return AccessResult :: forbidden ( ) ; }
Checks access for manage enrollment page.

@param \Drupal\Core\Session\AccountInterface $account
Run access checks for this account.

@return \Drupal\Core\Access\AccessResult
Check standard and custom permissions.
Checks access for manage enrollment page .