Group Join Password

Is there a way I can make it so that in order to join a group you need a password? I am making a buddypress site for my school and I don’t want people to be able to post inside of groups they don’t have a password to. I don’t want to make it so that a teacher has to accept and send a invitation every time as some have around 300 students. Any ideas how to do this?