Security support for search filtering based on authorizations. Also some query class improvements.