TaxonomyPermissions
class TaxonomyPermissions implements ContainerInjectionInterface (View source)
Provides dynamic permissions of the taxonomy module.
Traits
Provides a method to simplify generating bundle level permissions.
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.
Properties
| protected TranslationInterface | $stringTranslation | The string translation service. |
from StringTranslationTrait |
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
Methods
Builds a permissions array for the supplied bundles.
Translates a string to the current language or to a given language.
Formats a string containing a count of items.
Returns the number of plurals supported by a given language.
Gets the string translation service.
Constructs a TaxonomyPermissions instance.
Instantiates a new instance of this class.
Get taxonomy permissions.
Builds a standard list of taxonomy term permissions for a given vocabulary.
Details
protected array
generatePermissions(array $bundles, callable $permission_builder)
Builds a permissions array for the supplied bundles.
protected TranslatableMarkup
t(string $string, array $args = [], array $options = [])
Translates a string to the current language or to a given language.
See \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() for important security information and usage guidelines.
In order for strings to be localized, make them available in one of the ways supported by the
protected
formatPlural($count, $singular, $plural, array $args = [], array $options = [])
Formats a string containing a count of items.
protected
getNumberOfPlurals($langcode = NULL)
Returns the number of plurals supported by a given language.
protected TranslationInterface
getStringTranslation()
Gets the string translation service.
$this
setStringTranslation(TranslationInterface $translation)
Sets the string translation service to use.
__construct(EntityTypeManagerInterface $entity_type_manager)
Constructs a TaxonomyPermissions instance.
static
create(ContainerInterface $container)
Instantiates a new instance of this class.
This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.
array
permissions()
Get taxonomy permissions.
protected array
buildPermissions(VocabularyInterface $vocabulary)
Builds a standard list of taxonomy term permissions for a given vocabulary.