You are here

public function MessagePermissions::messageTemplatePermissions in Message UI 8

Gets an array of message type permissions.

Return value

array The message template permissions.

See also

\Drupal\user\PermissionHandlerInterface::getPermissions()

1 string reference to 'MessagePermissions::messageTemplatePermissions'
message_ui.permissions.yml in ./message_ui.permissions.yml
message_ui.permissions.yml

File

src/MessagePermissions.php, line 23

Class

MessagePermissions
Defines a class containing permission callbacks.

Namespace

Drupal\message_ui

Code

public function messageTemplatePermissions() {
  $perms = [];

  // Generate node permissions for all message templates.
  foreach (MessageTemplate::loadMultiple() as $template) {
    $perms += $this
      ->buildPermissions($template);
  }
  return $perms;
}