Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
n/a
0 / 0
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 3
crm_core_page_attachments
0.00% covered (danger)
0.00%
0 / 1
12
0.00% covered (danger)
0.00%
0 / 3
<?php
/**
 * @file
 * CRM Core module hooks.
 */
use Drupal\Core\Url;
/**
 * Implements hook_page_attachments().
 */
function crm_core_page_attachments(array &$attachments) {
  if (Url::fromRoute('crm_core.overview')->access() && \Drupal::currentUser()->hasPermission('access toolbar')) {
    $attachments['#attached']['library'][] = 'crm_core/admin';
  }
}