...
If the class enrollment changes frequently, it can be cumbersome to manually update the group. Another method to prevent Guests from accessing specific material in the course is to override the permissions for those items. To do this:
Go into
editingEdit mode
On the course page, click the
button for the item to restrictMultiexcerpt include MultiExcerptName MoodleEditButton PageWithExcerpt Moodle Home 3 vertical dots button and choose Edit settings
Under the title of the item, choose More and select Permissions
Click More → Permissions.
Under
Advanced role override, select the Guest role andActivity <type of item> you have selected, find the setting for View <type of item>
Click the Plus sign to the right of the list of roles, to bring up a list of roles to prohibit for that activity
Select the Guest role to change the viewing permissions to
PreventProhibit.
For example, when limiting access to a file, Under Activity: File change the View resource
value to Prevent.list to Prohibit for Guests(Note that you may have to remove the Guest user from the “Roles with Permission” list on that same line)