Restrict a class based on character gender

Basically i want to make a mod that you have a class that is only for male (lore reasons) and i want to make impossible to female hearthlings to be promoted to this class.
If any one can help with this i will be gratefully

If I’m correct, and it hasn’t been fixed, I believe that after creation, the gender of a Hearthling is not saved. This will probably be a big issue in regards to making something like that happen…

if thats true i will get some trouble to pull this one off