fix permission to manage public queries not respected

[``* `#15886` Permission to manage public queries not respected``](http://www.openproject.org/work_packages/15886)