You can set a course to not allow guests in. Is that what you mean? It is on the course settings page.
Roles and permissions
How to See a User's Capabilities in a Particular Context?
This discussion has been locked so you can no longer reply to it.