Problem: Non-enrolled users can't access courses with guest access enabled

Problem: Non-enrolled users can't access courses with guest access enabled

by Acqua Alta -
Number of replies: 5

Hi,


Moodle version: 3.7


Hi,

We encountered the following problem:


We have a Moodle system that doesn't allow guest LOGIN, since all the users (student and teachers) have to be enrolled in the courses that they want to access.

However, we have a couple of support courses that don't have participants, and all the users in the system should access. We tried to open these courses for guests the same way we did it in previous systems, but when non-enrolled users try to access these courses, they get the following message:


"This course is currently unavailable to students"


We made sure that we did the following:

1) We enabled the "Guest access" enrolment plugin in the "Site Administration" settings.

2) We enabled the "Guest access" enrolment method in the "Enrolment methods" area of the course settings.

3) We searched for relevant user capabilities, but the only one that we found doesn't seem relevant - Configure guest access instances (enrol/guest:config)


What's even stranger is that we have two different Moodle v3.7 that don't have this issue.

We're scratching our heads, what could be the cause for that issue? please help.


Thanks in advance smile




Average of ratings: -
In reply to Acqua Alta

Re: Problem: Non-enrolled users can't access courses with guest access enabled

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hello,

Please can you check in the course settings that the course visibility is set to show?

Average of ratings: Useful (1)
In reply to Helen Foster

תשובה ל: Re: Problem: Non-enrolled users can't access courses with guest access enabled

by Acqua Alta -
Hi Helen,
Thanks. Yes, I verified before writing my original post that the course visibility is set to "Yes.
It's of course something that should be checked when encountering this issue.

Below you can see my update about how the issue was solved.
In reply to Acqua Alta

תשובה ל: Problem: Non-enrolled users can't access courses with guest access enabled

by Acqua Alta -
TL;DR
---------
The relevant capability is "category:viewcourselist". You would encounter this issue only if you changed the default settings of this capability.


Detailed
-------------
After some digging, we found the issue:
There is a new capability in Moodle 3.7:
https://docs.moodle.org/37/en/Capabilities/moodle/category:viewcourselist


Some time before encountering the issue that I described above, it was set by me to "Not set" for almost all the users, since I did NOT want that teachers and student would be able to see a list of courses that they are not enrolled in. It just causes confusion for them if they see something that they can't access, and I guess that this is the reason the permission was created in the first place. Even if by default it lets users see the list of courses, now this behavior could be controlled by the admin.

However, the fact that I didn't want these users to see the list of courses in a category, doesn't contradict the fact that they should be able to access courses as guests (by enabling guest access for them in the "Enrolment methods" area of the course administration).
Average of ratings: Useful (3)
In reply to Acqua Alta

Re: תשובה ל: Problem: Non-enrolled users can't access courses with guest access enabled

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Great work Acqua in investigating and identifying the cause of the problem and thanks for reporting it in the tracker as MDL-66002. I've voted for it to be fixed.

In reply to Helen Foster

Re: תשובה ל: Problem: Non-enrolled users can't access courses with guest access enabled

by Michael de Raadt -
The bug listed above was found to be not a bug, although contentious.

My workaround was to allow the "moodle/category:viewcourselist" permission for Authenticated users on the category above the courses I wanted users to be able to access as guests and self-enrol. The permission is still unset at the site level as I don't want all users to be able to see the course list there.
Average of ratings: Useful (1)