Restriction by course role

Availability restriction ::: availability_role
Maintained by Logo "Moodle an Hochschulen e.V."Moodle an Hochschulen e.V., Alexander Bias
Moodle availability plugin which lets users restrict resources, activities and sections based on roles
Latest release:
1876 sites
72 fans
Current versions available: 17

If your teachers want to restrict activities / resources / sections in their course to a subset of the course participants and these course participants share a common course role, this plugin is for you.

Have a look at an example:

  • Tim Teacher is an editing teacher in course A.
  • Carl Clueless and Steve Smart are Tim's student assistants.
  • As Moodle admin, you have already created a custom course role called "student assistant" in your Moodle installation. Carl and Steve have this role in course A to do their work.
  • If Tim wants to provide activities / resources / sections only for Carl and Steve in course A, for example a forum activity where they can discuss internal stuff, he had to do some workarounds in the past. The most popular solution was to put Carl and Steve into a group and restrict the activities / resources / sections to this group, but there were even more complicated workarounds.

With availability_role, Tim does not need any workarounds anymore. He is just able to restrict his activities / resources / sections to a certain course role and all users who have this role in the course context have access.

Please see README file for details about the usage and features of this plugin.

No support in the comments section on this page

Please note that we don't provide any support for this plugin in the comments section on this page.

We appreciate your commendation and reviews for this plugin in the comments. For bug reports and support requests, please read the extensive information in the plugin's README file first and create, if needed, a ticket in the bug tracker which is linked below.

Thanks for your cooperation.


Screenshot #0


Logo "Moodle an Hochschulen e.V."
Moodle an Hochschulen e.V. (Lead maintainer): Maintainer
Alexander Bias: Maintainer
Ulm University: Initial Maintainer
Bence Laky: Initial Developer
Kathrin Osswald: Former Developer
Luca Bösch: Contributor
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • David Mudrák
    Fri, Feb 5, 2016, 12:54 AM

    Hi Alexander. Thanks for sharing this plugin with the community. Personally, I tend to consider setting availability this way a bit unnatural as I would expect that local permission overrides should be used instead. But I can understand that for many teachers (who are already familiar with the concept of availability restrictions) this way is actually more obvious. So yes, it can be useful in certain situations.

    Thanks for fixing some coding style issues reported above. I am happy to approve this plugin now. You are cleared to land. Welcome to the Plugins directory!

  • Alexander Bias
    Fri, Feb 5, 2016, 4:07 AM
    Hi David,

    just some more thoughts about your comment:
    I basically agree with you that local permission override might be Moodle core's tool to achieve the goal of this plugin, but the interface of the local permission override is far too complicated for this relatively simple use case and allowing teachers to locally override permissions gives them much more power than needed for this use case. That's why we built this small tool smile

  • Iñigo Zendegi Urzelai
    Fri, Sep 30, 2016, 4:57 PM

    I've just discovered this plugin and it does just what I was looking for!

    BTW, I found a case where the override permission cannot replace this: if you want to display a topic only to a certain role you can add a condition to that topic, but AFAIK there is no way to override permissions at a topic level so it can't be done that way.

  • Alexander Bias
    Fri, Sep 30, 2016, 5:50 PM
    Thanks, Iñigo, for your comment.

    Yes, you probably could achieve the same goal to restrict an activity to a certain role by override permissions on this activity, but this is exactly why we created this plugin: We don't want our teachers to fiddle with permission overrides, they should just be able to add a condition which defines to which role they want to restrict the activity.

  • Ernani da Silva
    Sat, May 20, 2017, 6:13 AM
    I installed the plugin, I activated the plugin and now I try to configure the activity.
    I want the activity to be available only after a grade is> 7.
    Apparently, all right. But the activity does not appear for the student
  • Ernani da Silva
    Sat, May 20, 2017, 6:51 AM
    Any help?
  • Ernani da Silva
    Sat, May 20, 2017, 8:46 AM
    It is fixed.
  • Supriya Dutta
    Sun, Jun 23, 2019, 2:25 PM
  • Naaman Fallouh
    Sun, Jul 4, 2021, 6:14 PM
    Does this plugin affects the guest role or any role derived from it?
  • Naaman Fallouh
    Sun, Jul 4, 2021, 7:03 PM
    I installed the plugin to try it, and found that it supports "Guest role" and "Not-logged-in role" which satisfies my need.

    But when trying to restrict a section in a course, I couldn't find the "Not-logged-in role" option among those appeared !!

    What's the best scenario to use this plugin to show parts of the course to the public while restricting other parts?

    Best regards.
  • Frédéric Massart ⭐
    Thu, Mar 10, 2022, 8:49 PM
    Brilliant, exactly what I was looking for. Thank you!

    Use case: giving guest access to a course but restricting most of its content to students.
  • Abdullah AlAbdullah
    Mon, Oct 16, 2023, 3:39 PM
    after i add the file and make restriction for who can view i select it's available just only for students and hidden otherwise
    but still the instructor can view it ?
  • Krste Rajchevski
    Thu, Oct 26, 2023, 7:02 PM
    Is this plugin still relevant?
Please login to post comments