interface FileAccessFormatterControlHandlerInterface in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/file/src/FileAccessFormatterControlHandlerInterface.php \Drupal\file\FileAccessFormatterControlHandlerInterface
Defines an interface for file access handlers that need to run on file formatters.
\Drupal\Core\Field\Plugin\Field\FieldFormatter\EntityReferenceFormatterBase, which file and image formatters extend, checks 'view' access on the referenced files before displaying them. That check would be useless and costly with Core's default access control implementation for files (\Drupal\file\FileAccessControlHandler grants access based on whether there are existing entities with granted access that reference the file). But it might be needed if a different access control handler with different logic is swapped in.
\Drupal\file\Plugin\Field\FieldFormatter\FileFormatterBase thus adjusts that behavior, and only checks access if the access control handler in use for files opts in by implementing this interface.
Hierarchy
- interface \Drupal\Core\Entity\EntityAccessControlHandlerInterface
- interface \Drupal\file\FileAccessFormatterControlHandlerInterface
Expanded class hierarchy of FileAccessFormatterControlHandlerInterface
All classes that implement FileAccessFormatterControlHandlerInterface
See also
\Drupal\file\Plugin\Field\FieldFormatter\FileFormatterBase::needsAccessCheck()
1 file declares its use of FileAccessFormatterControlHandlerInterface
- FileTestAccessControlHandler.php in core/
modules/ file/ tests/ file_test/ src/ FileTestAccessControlHandler.php - Contains \Drupal\file_test\FileTestAccessControlHandler.
File
- core/
modules/ file/ src/ FileAccessFormatterControlHandlerInterface.php, line 30 - Contains \Drupal\file\FileAccessFormatterControlHandlerInterface.
Namespace
Drupal\fileView source
interface FileAccessFormatterControlHandlerInterface extends EntityAccessControlHandlerInterface {
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityAccessControlHandlerInterface:: |
public | function | Checks access to an operation on a given entity or entity translation. | 1 |
EntityAccessControlHandlerInterface:: |
public | function | Checks access to create an entity. | 1 |
EntityAccessControlHandlerInterface:: |
public | function | Checks access to an operation on a given entity field. | 1 |
EntityAccessControlHandlerInterface:: |
public | function | Clears all cached access checks. | 1 |
EntityAccessControlHandlerInterface:: |
public | function | Sets the module handler for this access control handler. |