You are here

public function FillPdfAccessHelper::canGeneratePdfFromUrlString in FillPDF 8.4

Same name and namespace in other branches
  1. 5.0.x src/FillPdfAccessHelper.php \Drupal\fillpdf\FillPdfAccessHelper::canGeneratePdfFromUrlString()

Provides a way to pass in a FillPDF Link string to check access.

Should ultimately pass control to self::canGeneratePdfFromContext().

Parameters

string $url: The root-relative FillPDF URL that would be used to generate the PDF. e.g. /fillpdf?fid=1&entity_type=node&entity_id=1.

\Drupal\Core\Session\AccountInterface $account: The account.

Return value

\Drupal\Core\Access\AccessResultInterface The access results.

Overrides FillPdfAccessHelperInterface::canGeneratePdfFromUrlString

See also

\Drupal\fillpdf\FillPdfAccessHelperInterface::canGeneratePdfFromContext()

File

src/FillPdfAccessHelper.php, line 46

Class

FillPdfAccessHelper
Class FillPdfAccessHelper.

Namespace

Drupal\fillpdf

Code

public function canGeneratePdfFromUrlString($url, AccountInterface $account) {
  $context = $this->linkManipulator
    ->parseUrlString($url);
  return $this
    ->canGeneratePdfFromContext($context, $account);
}