Blocking one role from enrolling in courses?

Blocking one role from enrolling in courses?

by Adam Lipkin -
Number of replies: 7
(Running 1.8, although if this changes in the 1.9 release, I'm definitely interested in knowing that)

We have one particular role that we do NOT want to be able to enroll into a course, even if the instructor has enabled enrollment. Is there a way to block a role? I can't find anything under Define Roles that seems to work here.

Thanks,

Adam Lipkin
Brandeis University
Average of ratings: -
In reply to Adam Lipkin

Re: Blocking one role from enrolling in courses?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You are right, there is the role:unassignself capability (http://docs.moodle.org/en/Capabilities/moodle/role:unassignself) but no corresponding assignself capability.

Of course, before you are enrolled in a course, you are unlikely to have a role, but for some situations (Course-creator or Inspector-like roles) it would be useful. Perhaps you should file a feature request in the tracker.
In reply to Adam Lipkin

Re: Blocking one role from enrolling in courses?

by John Isner -
Can you say more about this role? Where is it assigned? When you say "a course" do you mean a specific course, or all courses? Do you want to allow users with the role to enter the course(s) with Guest-like privileges, but simply be preventing from enrolling? Or do you want to block them completely from access to the course(s)?
In reply to John Isner

Re: Blocking one role from enrolling in courses?

by Adam Lipkin -
John, good questions. let me provide more detail:

The role is a global role (Authenticated Users, actually).

This applies to all courses, and we want to block them from enrolling even if an instructor has set his or her course to allow enrollments. We want them to be able to log in to see a custom block on the My Moodle page, but to do nothing else.

For the most part, we're there, as turning off the Courses block on the My Moodle page and preventing this role from editing the page stops most attempts at browsing the system. The exception, however, is deep (direct) linking. If a user knows the url of a course, he or she can go right to it, and enroll in the course.

We do realize that it's not a likely situation, but it's a loophole that we'd like to find a way to close.

Thanks,

Adam Lipkin
Brandeis University
In reply to Adam Lipkin

Re: Blocking one role from enrolling in courses?

by John Isner -
That's a tough one. I can't think of a way to do it with roles. If you experiment, do it on a test system, or you may find yourself locked out of your site!

I think we need a capability that controls whether a user can see the "Enroll me in this course" button.
In reply to John Isner

Re: Blocking one role from enrolling in courses?

by Jo Meiklejohn -
Is it at all likely that a capability that controls whether a user can see the "Enroll me in this course" button will be added any time soon?
In reply to Jo Meiklejohn

Re: Blocking one role from enrolling in courses?

by Jason Hollowell -
Picture of Particularly helpful Moodlers

I just posted a message (inquiry) over in the enrollment forum yesterday (here) to see if anyone has experience with limiting access to courses based on a students role.

We give students a test at the beginning of the year and a level is determined from the results of that test.  I'd like to set up our Moodle site such that students can only enroll in courses that have the level designation that coincides with their level.

I'm starting to think that maybe it's not possible at the moment?

Jason

In reply to Jason Hollowell

Re: Blocking one role from enrolling in courses?

by Jason Hollowell -
Picture of Particularly helpful Moodlers

Shamelessly replying to myself here to bump to the top in the hopes of getting a response blush

Does anyone know how a student can be prevented from enrolling in a course?  I don't mean all coures, just certain courses and I need something a bit more 'advanced' / automated than the enrollment key.

Is there a way to create special roles (level specific in our case) that then are only allowed to enroll in certain courses?

Jason

P.S. How about a hack to the Availability portion of course settings to include "This course available to ********"  with ****** being a preset role?