function MediaHooks::viewsQuerySubstitutions
Implements hook_views_query_substitutions().
File
-
core/
modules/ media/ src/ Hook/ MediaHooks.php, line 280
Class
- MediaHooks
- Hook implementations for media.
Namespace
Drupal\media\HookCode
public function viewsQuerySubstitutions(ViewExecutable $view) {
$account = \Drupal::currentUser();
return [
'***VIEW_OWN_UNPUBLISHED_MEDIA***' => (int) $account->hasPermission('view own unpublished media'),
'***ADMINISTER_MEDIA***' => (int) $account->hasPermission('administer media'),
];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.