class AccessDenied in Flag 8.4
Test flag type plugin which denies access.
Plugin annotation
@FlagType(
id = "test_access_denied",
title = @Translation("Flag type plugin which denies access."),
entity_type = "node",
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\flag\FlagType\FlagTypeBase implements FlagTypePluginInterface uses StringTranslationTrait
- class \Drupal\flag\Plugin\Flag\EntityFlagType uses StringTranslationTrait
- class \Drupal\flag_test_plugins\Plugin\Flag\AccessDenied
- class \Drupal\flag\Plugin\Flag\EntityFlagType uses StringTranslationTrait
- class \Drupal\flag\FlagType\FlagTypeBase implements FlagTypePluginInterface uses StringTranslationTrait
Expanded class hierarchy of AccessDenied
File
- tests/
modules/ flag_test_plugins/ src/ Plugin/ Flag/ AccessDenied.php, line 20
Namespace
Drupal\flag_test_plugins\Plugin\FlagView source
class AccessDenied extends EntityFlagType {
/**
* {@inheritdoc}
*/
public function actionAccess($action, FlagInterface $flag, AccountInterface $account, EntityInterface $flaggable = NULL) {
if (empty($flaggable)) {
// Grant access if the method is called with no flaggable parameter. This
// is to ensure that access in the code being tested is properly passing
// the flaggable entity and not only relying on the general access case.
return AccessResult::allowed();
}
else {
return AccessResult::forbidden();
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AccessDenied:: |
public | function |
Checks whether a user has permission to flag/unflag or not. Overrides EntityFlagType:: |
|
EntityFlagType:: |
protected | property | The entity type defined in plugin definition. | |
EntityFlagType:: |
protected | property | The entity type manager. | |
EntityFlagType:: |
public | function |
Returns the permissions available to this flag type. Overrides FlagTypeBase:: |
1 |
EntityFlagType:: |
public | function |
Provides a form for this action link plugin settings. Overrides FlagTypeBase:: |
1 |
EntityFlagType:: |
public static | function |
Creates an instance of the plugin. Overrides FlagTypeBase:: |
|
EntityFlagType:: |
public | function |
Gets default configuration for this plugin. Overrides FlagTypeBase:: |
1 |
EntityFlagType:: |
protected | function |
Defines options for extra permissions. Overrides FlagTypeBase:: |
2 |
EntityFlagType:: |
protected | function | Defines permissions for the 'owner' set of additional action permissions. | 1 |
EntityFlagType:: |
public | function | Determines if the given form operation is add or edit. | 1 |
EntityFlagType:: |
protected | function | Determines if the flaggable associated with the flag supports ownership. | 1 |
EntityFlagType:: |
public | function | Returns the show as field setting. | |
EntityFlagType:: |
public | function | Returns the show on contextual link setting. | |
EntityFlagType:: |
public | function | Return the show in links setting given a view mode. | |
EntityFlagType:: |
public | function | Returns the show on form setting. | |
EntityFlagType:: |
public | function |
Handles the form submit for this action link plugin. Overrides FlagTypeBase:: |
1 |
EntityFlagType:: |
public | function |
Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides FlagTypeBase:: |
|
FlagTypeBase:: |
protected | property | The module handler. | |
FlagTypeBase:: |
public | function | ||
FlagTypeBase:: |
public | function |
Gets this plugin's configuration. Overrides ConfigurableInterface:: |
|
FlagTypeBase:: |
protected | function | Determines whether the flag is set to have the extra permissions set. | |
FlagTypeBase:: |
public | function |
Sets the configuration for this plugin instance. Overrides ConfigurableInterface:: |
|
FlagTypeBase:: |
public | function |
Handles the validation for the action link plugin settings form. Overrides PluginFormInterface:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |