How to order a view by access control on files? I have a view that displays a series of nodes in a blog format.  Each node has a file attached to it.  How do I make the nodes with files that the user has to login to see come last in the list?

I've been looking through the options available in Views and have come up short there.  I was hoping I could create a relationship on the file, but I can't find any properties that relate to access control.

My other thought was that I could do this in a template, but I'm not sure if there is a template that will let me change the order of the rows in the view.  Are those variables passed to the template by reference?

Many thanks.
In views under the Advanced section when you select the Theme: Information link, you can select to override a specific field.

Choose the most appropriate naming convention as this will dictate the scope of your override. Copy the text given by views and copy this into a new file in your theme called the .tpl.php file name you chose.

Once there you can add a conditional statement before outputting your field with user_access to check if your user has the right permissions to view the downloads.

You might have to specify the permission in your own module with hook_permission.