Students still able to access courses after self-enrollment is disabled (Moodle 2.4.8)

Re: Students still able to access courses after self-enrollment is disabled (Moodle 2.4.8)

by Carson Tam -
Number of replies: 0

Looks like there is a bug with "moodle/course:view" capability.

 

I was able to reproduce what you described above by modifying the Student role with "View courses without participation" (moodle/course:view) set to "Allow".

 

I tried this in both Moodle 2.4.9 and Moodle 2.6, as well as on Moodle Demo (demo.moodle.net).

 

According to the definition of the "moodle/course:view" capability in http://docs.moodle.org/26/en/Capabilities/moodle/course:view, a user with this capability should be able to view this course without being enrolled, but the behaviour seems to be opposite.

 

The current behaviour is that if the user has never been enrolled in this course, then s/he will not be able to view this course. But if s/he has enrolled in this course before (even the enrollment has turned off after), s/he will be able to view the course.

 

I think the correct behaviour should be if the user has this capability (moodle/course:view) set to allowed, s/he should be able to view this course whether or not s/he is enrolled.

 

Thoughts?