Fixes permission check in QueriesController (#5181).
Authored by: jplang 2010-03-24
Parent: [r3610]
Child: [r3612]