Restricting courses to departments/teams
While creating/editing a self paced course, the Course Creator can restrict their courses to be visible only to the selected departments/teams.

In the Course Settings section, select Course Visibility as ‘Restricted’. After selecting this option, a new field Select group(s) will appear, where you can enter the departments/teams for which the course has to be visible. Click Save.
Access/Visibility of restricted course:
Learning
Under the Browse courses tab, all the courses restricted to their department/team and courses which are open to all can be viewed.
Mentoring
Mentors will be able to assign only those courses which are visible to both them and their learners.
Course Management
Only those who create the restricted course/course administrators/those who have permission to manage all courses, and belong to the department, to which the course is restricted to will be able to manage such courses.