Tests and fixes for query options authorisation.