interface UserProtectionInterface in User protect 8
Defines the interface for user protection plugins.
Hierarchy
- interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Component\Plugin\ConfigurableInterface; interface \Drupal\Component\Plugin\DependentPluginInterface
- interface \Drupal\userprotect\Plugin\UserProtection\UserProtectionInterface
Expanded class hierarchy of UserProtectionInterface
All classes that implement UserProtectionInterface
1 file declares its use of UserProtectionInterface
- ProtectionRuleUnitTest.php in tests/
src/ Kernel/ Entity/ ProtectionRuleUnitTest.php
File
- src/
Plugin/ UserProtection/ UserProtectionInterface.php, line 15
Namespace
Drupal\userprotect\Plugin\UserProtectionView source
interface UserProtectionInterface extends PluginInspectionInterface, ConfigurableInterface, DependentPluginInterface {
/**
* Returns the user protection label.
*
* @return string
* The user protection label.
*/
public function label();
/**
* Returns the description of the protection.
*
* @return string
* The user protection description.
*/
public function description();
/**
* Returns the weight of the user protection.
*
* @return int
* The protections' weight.
*/
public function getWeight();
/**
* Returns if plugin is enabled.
*
* @return bool
* TRUE if the plugin is enabled.
* FALSE otherwise.
*/
public function isEnabled();
/**
* Checks if a given operation on an user should be protected.
*
* @param \Drupal\user\UserInterface $user
* The user object to check access for.
* @param string $op
* The operation that is to be performed on $user.
* @param \Drupal\Core\Session\AccountInterface $account
* The account trying to access the entity.
*
* @return bool
* TRUE if the operation should be protected.
* FALSE if the operation is not protected by this plugin.
*/
public function isProtected(UserInterface $user, $op, AccountInterface $account);
/**
* Applies protections to user account form.
*
* @param array $form
* Nested array of form elements that comprise the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @return bool
* TRUE if the protection was applied.
* FALSE otherwise.
*/
public function applyAccountFormProtection(array &$form, FormStateInterface $form_state);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurableInterface:: |
public | function | Gets default configuration for this plugin. | 11 |
ConfigurableInterface:: |
public | function | Gets this plugin's configuration. | 12 |
ConfigurableInterface:: |
public | function | Sets the configuration for this plugin instance. | 12 |
DependentPluginInterface:: |
public | function | Calculates dependencies for the configured plugin. | 19 |
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |
UserProtectionInterface:: |
public | function | Applies protections to user account form. | 1 |
UserProtectionInterface:: |
public | function | Returns the description of the protection. | 1 |
UserProtectionInterface:: |
public | function | Returns the weight of the user protection. | 1 |
UserProtectionInterface:: |
public | function | Returns if plugin is enabled. | 1 |
UserProtectionInterface:: |
public | function | Checks if a given operation on an user should be protected. | 1 |
UserProtectionInterface:: |
public | function | Returns the user protection label. | 1 |