Course category only visible for selected users

Course category only visible for selected users

Fabian Kaiser -
Колькасьць адказаў: 4
Hi Moodlers!

I have the following situation:
Normally all Course Categories are visible for the students.
But now i want to create a special course category which should be only visible for selected users or in another way: users i give access to.

How can i do this?
Сярэдняе рэйтынгаў: -
У адказ на Fabian Kaiser

Re: Course category only visible for selected users

Michael Hughes -
Выява Core developers Выява Particularly helpful Moodlers Выява Plugin developers
On the special category revoke (i.e. prevent) the view capability for the authenticated user role (which *everyone* normally holds)

You'll then need to have a role defined that you can assign to the specific users that gives them back the view capability.

Students aren't typically in the student role outside of a course context (where they are *enrolled*) so most of the general capabilities are set via the Authenticated User role.
У адказ на Michael Hughes

Re: Course category only visible for selected users

Fabian Kaiser -
HI Michael!

Thank you for your help. I managed to create the custom role and i also removed the "authenticated user role" from beeing able to see this particular course category.
Now im struggling in the last step - assigning my new custom role to a user.
All i can find is the section to "assign system roles" but here my custom role does not appear.

Am i in the wrong section or how can i do this?
У адказ на Fabian Kaiser

Re: Course category only visible for selected users

Michael Hughes -
Выява Core developers Выява Particularly helpful Moodlers Выява Plugin developers
So you need to go to /course/management.php and into the relevant category and assign the role there.

However you need to make sure on your Role definition you have set it so that it can be assigned to category contexts.