class YamlFormUiAccess in YAML Form 8
Defines the custom access control handler for the form UI.
Hierarchy
- class \Drupal\yamlform_ui\Access\YamlFormUiAccess
Expanded class hierarchy of YamlFormUiAccess
File
- modules/
yamlform_ui/ src/ Access/ YamlFormUiAccess.php, line 13
Namespace
Drupal\yamlform_ui\AccessView source
class YamlFormUiAccess {
/**
* Check that form source can be updated by a user.
*
* @param \Drupal\yamlform\YamlFormInterface $yamlform
* A form.
* @param \Drupal\Core\Session\AccountInterface $account
* Run access checks for this account.
*
* @return \Drupal\Core\Access\AccessResultInterface
* The access result.
*/
public static function checkYamlFormSourceAccess(YamlFormInterface $yamlform, AccountInterface $account) {
return AccessResult::allowedIf($yamlform
->access('update', $account) && $account
->hasPermission('edit yamlform source'));
}
/**
* Check that form option source can be updated by a user.
*
* @param \Drupal\yamlform\YamlFormOptionsInterface $yamlform_options
* A form options entity.
* @param \Drupal\Core\Session\AccountInterface $account
* Run access checks for this account.
*
* @return \Drupal\Core\Access\AccessResultInterface
* The access result.
*/
public static function checkYamlFormOptionSourceAccess(YamlFormOptionsInterface $yamlform_options, AccountInterface $account) {
return AccessResult::allowedIf($yamlform_options
->access('update', $account) && $account
->hasPermission('edit yamlform source'));
}
/**
* Check that form can be updated by a user.
*
* @param \Drupal\yamlform\YamlFormInterface $yamlform
* A form.
* @param \Drupal\Core\Session\AccountInterface $account
* Run access checks for this account.
*
* @return \Drupal\Core\Access\AccessResultInterface
* The access result.
*/
public static function checkYamlFormEditAccess(YamlFormInterface $yamlform, AccountInterface $account) {
return AccessResult::allowedIf($yamlform
->access('update', $account));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
YamlFormUiAccess:: |
public static | function | Check that form can be updated by a user. | |
YamlFormUiAccess:: |
public static | function | Check that form option source can be updated by a user. | |
YamlFormUiAccess:: |
public static | function | Check that form source can be updated by a user. |