You are here

public static function YamlFormUiAccess::checkYamlFormOptionSourceAccess in YAML Form 8

Check that form option source can be updated by a user.

Parameters

\Drupal\yamlform\YamlFormOptionsInterface $yamlform_options: A form options entity.

\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::checkYamlFormOptionSourceAccess'
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 41

Class

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

Namespace

Drupal\yamlform_ui\Access

Code

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