You are here

function media_views_query_substitutions in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/media.module \media_views_query_substitutions()
  2. 9 core/modules/media/media.module \media_views_query_substitutions()

Implements hook_views_query_substitutions().

File

core/modules/media/media.module, line 524
Provides media items.

Code

function media_views_query_substitutions(ViewExecutable $view) {
  $account = \Drupal::currentUser();
  return [
    '***VIEW_OWN_UNPUBLISHED_MEDIA***' => (int) $account
      ->hasPermission('view own unpublished media'),
    '***ADMINISTER_MEDIA***' => (int) $account
      ->hasPermission('administer media'),
  ];
}