Authentication and data filtering. Fixes #866.

Reviewers checklist:

* [x] Comprehension check
* [x] Role union
* [x] Multiple user handling
* [x] Filtering
* [x] Tickets for future changes