You are here

public static function YamlFormUiAccess::checkYamlFormSourceAccess in YAML Form 8

Check that form source can be updated by a user.

Parameters

\Drupal\yamlform\YamlFormInterface $yamlform: A form.

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

Return value

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

1 string reference to 'YamlFormUiAccess::checkYamlFormSourceAccess'
yamlform_ui.routing.yml in modules/yamlform_ui/yamlform_ui.routing.yml
modules/yamlform_ui/yamlform_ui.routing.yml

File

modules/yamlform_ui/src/Access/YamlFormUiAccess.php, line 26

Class

YamlFormUiAccess
Defines the custom access control handler for the form UI.

Namespace

Drupal\yamlform_ui\Access

Code

public static function checkYamlFormSourceAccess(YamlFormInterface $yamlform, AccountInterface $account) {
  return AccessResult::allowedIf($yamlform
    ->access('update', $account) && $account
    ->hasPermission('edit yamlform source'));
}