Logged in user unable to view Guest Category and Courses

Logged in user unable to view Guest Category and Courses

از David Broad در
Number of replies: 4

On my site I have a Guest category and Guest courses which are displayed fine when someone views them as a guest.

But when a Student logs in they are unable to view the Guest Category/Courses and this message is displayed:


You don't have permission to view courses here

More information about this error


I was under the impression that Guest items are automatically viewable by anyone who was logged in as well as guest users. Can anything happen to hide them from logged in users?

Thanks for your help


میانگین امتیازات: -
In reply to David Broad

Re: Logged in user unable to view Guest Category and Courses

از Helen Foster در
تصویر Core developers تصویر Documentation writers تصویر Moodle HQ تصویر Particularly helpful Moodlers تصویر Plugin developers تصویر Testers تصویر Translators

Hi David,

There is a new capability in Moodle 3.7 onwards, 'View list of courses you are not enrolled in' (Capabilities/moodle/category:viewcourselist) which you need to make sure is allowed for the Authenticated user role, for users to be able to view the guest category and courses.

In reply to Helen Foster

Re: Logged in user unable to view Guest Category and Courses

از David Broad در

Hi Helen,

Thanks so much for your reply , that worked perfectly! 

I had tried adding the 'Student' role there but it had no effect, 'Authenticated User' was what was needed.

Thanks!

In reply to David Broad

Re: Logged in user unable to view Guest Category and Courses [Solved]

از Helen Foster در
تصویر Core developers تصویر Documentation writers تصویر Moodle HQ تصویر Particularly helpful Moodlers تصویر Plugin developers تصویر Testers تصویر Translators

Hi David,

Good to hear that you've got things working now! (I didn't have chance to test my suggested solution!)

The reason why allowing the capability for the student role didn't work, is because some capabilities only work in certain contexts. moodle/category:viewcourselist only works in the site context (system role or authenticated user role) or category context (role in a category). Generally the student role is assigned in the course context (enrolling a user in a course).