The Mishna (Chagigah 2:1 or 11b) indeed writes
One may not expound the laws of forbidden sexual relations before
three people, nor the account of Creation before two, nor the Divine
Chariot before one, unless he is wise and understanding from his own
knowledge.
The Rambam writes that one should not study Kabbala before one has a very strong knowledge of Torah, Mishna and Gemara (MT Hilchot Yesodei HaTorah 4:13)
I maintain that it is not proper for a person to stroll in the Pardes
unless he has filled his belly with bread and meat. "Bread and meat"
refer to the knowledge of what is permitted and what is forbidden, and
similar matters concerning other mitzvot. Even though the Sages
referred to these as "a small matter" - for our Sages said: "'A great
matter,’ this refers to Ma'aseh Merkavah. `A small matter,’ this
refers to the debates of Abbaye and Ravva" - nevertheless, it is
fitting for them to be given precedence, because they settle a
person's mind.
R Gil Student quotes R Ovadia Yosef (from Yechaveh Da’as 4:47 and Yabi’a Omer 10:YD 23)
The Gemara (Chagigah 13a, 14a) states that one may only share the
“secrets” of the Torah with a great Torah scholar. Kabbalists, like
Rav Chaim Vital (introduction to Eitz Chaim 1d) and the Shelah (vol. 1
29b), explicitly say that only great scholars should learn Kabbalah.
Halakhists, like Rav Moshe Isserles (Shulchan Arukh, Yoreh De’ah 246:4
and Toras Ha-Olah 3:4) and the Vilna Ga’on (Yoreh De’ah, ad loc. and
Prov. 21:17) agree.
But see here, here and here why some incl. Chabad think we need Kabala more than before.