How can I run a query in the views in the context of the user access?
I've found possibility to do it in hook_views_post_build:

function MY_MODYLE_views_post_build($view) {
  if($view-&gt;name == 'MY_VIEW_NAME') {
    $query = $view-&gt;build_info['query'];
    $query-&gt;addMetaData('account', user_load(47));
  }
}


I've noticed that we have SelectQuery object only after query build (in views.inc $this-&gt;query-&gt;build($this);). 

After it only one hook is executed views_post_build.