You are here

function opigno_catalog_views_pre_render in Opigno training catalog 8

Implements hook_views_pre_render().

File

./opigno_catalog.module, line 80
Contains opigno_catalog.module.

Code

function opigno_catalog_views_pre_render(ViewExecutable $view) {
  if ($view
    ->id() !== 'opigno_training_catalog') {
    return;
  }
  $user = \Drupal::currentUser();
  if ($user
    ->hasPermission('manage group members in any group') || $user
    ->hasPermission('manage group content in any group')) {

    // Allow platform-level managers to access any training.
    return;
  }
}