You are here

public function FormModeManagerPermissions::formModeManagerPermissions in Form mode manager 8

Same name and namespace in other branches
  1. 8.2 src/FormModeManagerPermissions.php \Drupal\form_mode_manager\FormModeManagerPermissions::formModeManagerPermissions()

Returns an array of Form mode manager permissions.

See also

\Drupal\user\PermissionHandlerInterface::getPermissions()

1 string reference to 'FormModeManagerPermissions::formModeManagerPermissions'
form_mode_manager.permissions.yml in ./form_mode_manager.permissions.yml
form_mode_manager.permissions.yml

File

src/FormModeManagerPermissions.php, line 60

Class

FormModeManagerPermissions
Provides dynamic permissions of the form_mode_manager module.

Namespace

Drupal\form_mode_manager

Code

public function formModeManagerPermissions() {
  $perms = [];
  $form_modes_definitions = $this->formModeManager
    ->getAllFormModesDefinitions();
  foreach ($form_modes_definitions as $entity_type_id => $form_modes) {
    $perms += $this
      ->buildDefaultPermissions($entity_type_id);
    $perms += $this
      ->buildFormModePermissions($entity_type_id, array_keys($form_modes));
  }
  return $perms;
}