This allows users to enroll themselves in courses. As with guest access, you must enable this method under Site administration for your entire site and also activate
it for a specific course.
On the Settings page for Self enrolment, you can choose to require an enrollment key:
The enrolment key is a code that the user must enter when enrolling in a course. Once the user is enrolled, the enrolment key is no longer needed.
You can allow self-registration on your site and then require users to have an enrolment key for a course. The self-registration removes the burden of you creating accounts for users. The enrolment key ensures that only those to whom you give the key can enter your course.