which hook to change the node order in a view? I have a custom view but now I want to put the nodes created by a specific user role on top.

I want to do this using code so I can easily implement this throughout multiple web pages.

I'm thinking to alter the query or to put an array sort before the nodes are rendered.

But I don't know which hook would be useful for this.

edit:
using hook_views_pre_render as suggested by Jimajamma

function vacancies_views_pre_render(&amp;$view) {
  dsm($view-&gt;result);
  $view-&gt;result = array_reverse($view-&gt;result);
  dsm($view-&gt;result);
}


But that doesn't change the order of the nodes in the view ( putting a dsm($view); in the if statement ensures me that it is this view that is called. )
You can use View's prerender hook to modify the view's results anyway you want.

For example,

function YOURMODULE_views_pre_render(&amp;$view) {

   if ($view-&gt;name=='xyzzy') {

      // modify/sort the $view-&gt;result array to your heart's content here
      // for example, reverse it...
      $view-&gt;result=array_reverse($view-&gt;result);

   }

 }


Basically $view-&gt;result is an array of row results, so, just go through it and grab the rows you want first, then follow that up with the remaining rows.  

ADDITION:

I created a quick view and did the above reversing and it certainly reversed the order so I am not sure what you are doing ever so slightly wrong to not see similar behavior on your site.