Fix/query permissions

[``* `#15886` Permission to manage public queries not respected``](http://www.openproject.org/work_packages/15886)
Perceived complexity for allowed_links_on_query is too high. [8/7]