Well, the message "This course is currently unavailable to students" indicates the Course is hidden from the logged in user.
Quick look at: http://docs.moodle.org/25/en/Capabilities/moodle/course:view
- This capability allows a user to view a course without being enrolled in it.
- Comment: So this capability isn't actually connected to the enrolment process - which means it is probably not going to be a solution (or only part of the solution) if you are using this route to control access to Courses
- Roles with this capability set to allow are available for Other users to be assigned to.
- Users with this capability are NOT listed as course participants.
- Comment: If they are not listed as Course Participants then this would explain why a user with this role doe not see the Course in their list
- The default manager role has this capability set to allow. For all other default roles, the capability is not set.
- Comment: So the intention of this capability is simply to allow a user to view the contents of a Course without being enrolled - which isn't where I think you are heading with this idea ?
My understanding is that even if the users have this capability, it's the enrolment method, and the fact that that Courses are hidden, which will control which Courses the user will see.
Depending on how your site is setup (e.g. Courses and Categories), and how your users are being organised, you might find it easier to use Categories and Category enrolments ?
Without spending some time testing this for real, and without knowing exactly how you think the site should operate, it's difficult to say more
However, you might think about copying the Manager role, which has this capability already setup, and then working out what you need to take away from the role to achieve what you want?
However, I still think trying to give a role at site level access to hidden courses is a convoluted approach, and might never work.