Two distinct groups of users need different default roles

Two distinct groups of users need different default roles

by James Tuttle -
Number of replies: 4

Hello everyone!  We are a K-12 educational institution using Moodle as the engine for our entire website.  Thus we have two distinct groups of users that we need to serve - our staff and students, and the courses they are enrolled in, along with the general public, who visit certain areas of our website that we have set up as courses with allowed guest access.

What we would like to do is allow the general public to create user accounts on our website, so that they will have certain limited abilities within these public areas, such as the ability to respond to surveys, and so they can subscribe to the forums we set up.

To make this happen, we created a role that we call "Registered Guest", which essentially takes the Guest role and adds a few more limited capabilities to it.  The idea is that this role has the ability to conduct a few activities on our website, but cannot see any identifiable information about any other user.

This community here was able to help me set my system up in such a way that, while our staff & students draw their Moodle accounts from an Active Directory database, outside users are allowed to create manual accounts, which require that their user name be their e-mail address.  This prevents duplication of user names between the two groups of users.

In my user policies, I have the default role for users who enroll in a course set to "Student."  What I would like to do is have different default roles, depending on what type of user you are.  If I could get the system to say "oh, well I see you are enrolling in a course from the general public (because your user name has the @ symbol in it), so your role is Registered Guest."  Meanwhile, all my Active Directory users are allowed to enroll in courses with their default role set to "Student."

Is this possible to do on a single Moodle site, or am I dreaming?  Thank you for your help (and for reading my long diatribe.)

Average of ratings: -
In reply to James Tuttle

Re: Two distinct groups of users need different default roles

by John Isner -
Please list the requirements for these visitors from the general public. Don't give solutions, just requirements.
In reply to John Isner

Re: Two distinct groups of users need different default roles

by James Tuttle -
Users from the general public need to be able to enroll in certain courses with a very limited set of privileges, while our regular students need to be able to enroll in other courses as regular students. What I'd love to be able to do is have the system be able to say upon user login "ok, user x you're from the general public, you get this very limited set of privileges", but to our regular students, give them the regular student role.

I've been able to set up my site so that anyone who creates their own account from the outside has to use an e-mail address as their user name, so if I could figure out a way to direct users to different roles based on whether they have a manual account or an active directory account, it would be ideal.
In reply to James Tuttle

Re: Two distinct groups of users need different default roles

by John Isner -
OK, I see, thanks. It's a very interesting problem, but unfortunately I don't think there's a solution without a new feature (see paragraph 2). Currently, all users are automatically assigned the same role when they log in (Site administration -> Users -> Permissions -> Site policies -> Default role for all users, by default Authenticated user) regardless of how their accounts were created. Similarly, users who self-enroll in a course are automatically assigned the same role when they enter the course (Site administration -> Users -> Permissions -> Site policies -> Default role for users in a course, by default Student). You can always solve the problem with manual role assignment, but you want it to be automatic.

Your problem could be solved by a new feature: triggers that admins could set in any context, which would cause an automatic role assignment when a user with certain characteristics entered the context. One of the characteristic could be authentication method. I'm curious to see what the developers have to say about this, so I entered MDL-14298 into the tracker.
In reply to John Isner

Re: Two distinct groups of users need different default roles

by James Tuttle -
Yes, that's exactly what I'm looking for.  Thank you for entering this into the tracker.  I'm anxious to see what happens with it as well!