Fix queries permissions