How to allow logged in users ONLY 'guest access' to certain courses?

How to allow logged in users ONLY 'guest access' to certain courses?

by Ruthine Burton -
Number of replies: 3

Is it possible to configure the settings for allowing 'guest access' so that a group of logged in users (students in this case) can view certain courses on which they are NOT enrolled? 

The important point here is that non-logged in users (ie guests) should NOT be able to access the VLE or any courses /pages on the VLE, even though 'guest access' is turned on. Only our students should be able to use the guest access.

I have explored the route of defining a role with course:view set to allow, but my understanding is that this has to be assigned at the SYSTEM level and thus would allow access to all courses/VLE pages. For students, this would not be appropriate.

Thank you for any advice anyone can share.

We are on Moodle 3.6

Average of ratings: -
In reply to Ruthine Burton

Re: How to allow logged in users ONLY 'guest access' to certain courses?

by Ray Hinton -
I believe you can just enable the "Guest access" enrollment method in the course, without enabling it on your site. Then, once people log in, they can navigate to the course from the front page.

I think that would be the most straightforward way to achieve what you want, although it might be burdensome if you have a lot of courses.

Other options might be:

- A custom role that can be assigned at the Category level (probably do not allow moodle:course/viewhiddencourses)
- Self enrollment, with Default assigned role = Guest
- Cohort enrollment, or batch upload users, to quickly enroll people into a course with the Guest role

Those all have some appeal to them, but require a bit more fiddling.
In reply to Ray Hinton

Re: How to allow logged in users ONLY 'guest access' to certain courses?

by Ruthine Burton -

Hi Ray,

Thanks for replying. I did work this out in the end. Much as you suggest: I enabled 'guest access' at course level but disabled it at site level... 

I have created custom roles for teachers - assigned at site level (again as you suggest with no viewing of hidden courses) but it's just not practical for students. They would still get site wide access! 

I needed an option for students. The college I work for wants teachers and students to be able to 'view' all courses in addition to role context access to courses on which they are fully enrolled. The college does not want students (or lecturers) to be 'enrolled' on all the courses. This just causes confusion as they end up with hundreds of courses on their landing page... Category enrolment of a custom role would result in enrolment I believe... My understanding is that only 'site level' assignment of a custom role will enable access without actual enrolment.

This seems to work. I've had to enable 'force users to log in' in the settings. The landing page is stripped back, with guest access button disabled and no links to the internal site - as far as possible. Seems to work but still testing.

Thanks again...

Ruthine

In reply to Ruthine Burton

Re: How to allow logged in users ONLY 'guest access' to certain courses?

by Ray Hinton -
Glad you've found something that works.

We are using a custom role based on the Teacher archetype and we assign it to people at the Category context. It's the end of the day and my mind is mixed up in Role/Permission spaghetti right now, but if that solution (Category Guest role) sounds useful to you, then you might want to give it a second look. smile I mostly mention this solution since I think this could give you better control over what courses Student Guests can see (perhaps you have a separate category for testing courses or where teachers collaborate), and it would let you control the access without needing to go into every single course and change the enrollment method.

For example, this Moodle docs page describes how to assign Teacher at the Category context and also suggests the possibility of doing it with a new role.

https://docs.moodle.org/38/en/Teacher_role#Assigning_The_Teacher_Role_category_wide