You are here

public static function YamlFormAccess::checkSubmissionAccess in YAML Form 8

Check whether the user can view submissions.

Parameters

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

Return value

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

File

src/Access/YamlFormAccess.php, line 38

Class

YamlFormAccess
Defines the custom access control handler for the form entities.

Namespace

Drupal\yamlform\Access

Code

public static function checkSubmissionAccess(AccountInterface $account) {
  return AccessResult::allowedIf($account
    ->hasPermission('administer yamlform') || $account
    ->hasPermission('administer yamlform submission') || $account
    ->hasPermission('view any yamlform submission'));
}