You are here

function cas_menu_links_discovered_alter in CAS 8

Same name and namespace in other branches
  1. 2.x cas.module \cas_menu_links_discovered_alter()

Implements hook_menu_links_discovered_alter().

File

./cas.module, line 310
Provides CAS authentication for Drupal.

Code

function cas_menu_links_discovered_alter(&$links) {

  // The "admin toolbar tools" module adds a "Add a new user" menu item to
  // the "People" admin menu. Here we supplement that with one for adding
  // CAS users as well. We could also just add this via cas.links.menu.yml,
  // but we only want it to appear if the admin toolbar tools module is also
  // enabled.
  if (\Drupal::moduleHandler()
    ->moduleExists('admin_toolbar_tools')) {
    $links['cas.bulk_add_users'] = [
      'title' => t('Add CAS user(s)'),
      'provider' => 'cas',
      'route_name' => 'cas.bulk_add_cas_users',
      'menu_name' => 'admin',
      'parent' => 'entity.user.collection',
      'weight' => -1,
    ];
  }
}