You are here

public function MenuAdminPerMenuPermissions::permissions in Menu Admin per Menu 8

Returns an array of menu_admin_per_menu permissions.

Return value

array Array of permissions associated with menus.

1 string reference to 'MenuAdminPerMenuPermissions::permissions'
menu_admin_per_menu.permissions.yml in ./menu_admin_per_menu.permissions.yml
menu_admin_per_menu.permissions.yml

File

src/MenuAdminPerMenuPermissions.php, line 35

Class

MenuAdminPerMenuPermissions
Menu Admin Per Menu Permissions class.

Namespace

Drupal\menu_admin_per_menu

Code

public function permissions() {
  $permissions = [];
  $menus = $this
    ->getExistingMenus();
  foreach ($menus as $name => $title) {
    $permission = 'administer ' . $name . ' menu items';
    $permissions[$permission] = [
      'title' => $this
        ->t('Administer <em>@menu</em> menu items', [
        '@menu' => $title,
      ]),
    ];
  }
  return $permissions;
}