function media_views_query_substitutions in Drupal 8
Same name and namespace in other branches
- 9 core/modules/media/media.module \media_views_query_substitutions()
Implements hook_views_query_substitutions().
File
- core/
modules/ media/ media.module, line 522 - 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'),
];
}