function FilterFormat::getPermissionName

Same name and namespace in other branches
  1. 10 core/modules/filter/src/Entity/FilterFormat.php \Drupal\filter\Entity\FilterFormat::getPermissionName()
  2. 9 core/modules/filter/src/Entity/FilterFormat.php \Drupal\filter\Entity\FilterFormat::getPermissionName()
  3. 8.9.x core/modules/filter/src/Entity/FilterFormat.php \Drupal\filter\Entity\FilterFormat::getPermissionName()
  4. main core/modules/filter/src/Entity/FilterFormat.php \Drupal\filter\Entity\FilterFormat::getPermissionName()

Returns the machine-readable permission name for the text format.

Return value

string|false The machine-readable permission name, or FALSE if the text format is malformed or is the fallback format (which is available to all users).

Overrides FilterFormatInterface::getPermissionName

2 calls to FilterFormat::getPermissionName()
FilterFormat::getRoles in core/modules/filter/src/Entity/FilterFormat.php
Retrieves a list of roles that are allowed to use this format.
FilterFormat::postSave in core/modules/filter/src/Entity/FilterFormat.php
Acts on a saved entity before the insert or update hook is invoked.

File

core/modules/filter/src/Entity/FilterFormat.php, line 268

Class

FilterFormat
Represents a text format.

Namespace

Drupal\filter\Entity

Code

public function getPermissionName() {
  return !$this->isFallbackFormat() ? 'use text format ' . $this->id() : FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.