Returns 401 Unauthorized for queries without permission