WeBWorK Main Forum

Can we restrict email change by user?

Can we restrict email change by user?

by L Ng -
Number of replies: 8

Hello there.

We are using WeBWork with our lms via LTI and was wondering, like in our LMS, can we restrict the WebWork users from changing their own email address? This way, we can ensure that users can only have one email and designated by our institution for consistency.

Basically, can we lock in and prohibit changes to their email address.

is this possible?

thanks




In reply to L Ng

Re: Can we restrict email change by user?

by Arnold Pizer -

In defaults.conf, you will see the line

change_email_address           => "student",

If you want to make this change for a single course, put the following line in that course's course.conf file. If you want to change it for all courses, put it in localOverrides.conf

$permissionLevels{change_email_address} = "professor";

Then only professors can change email addresses.  Note that I haven't actually tried this.


In reply to L Ng

Re: Can we restrict email change by user?

by Alex Jordan -

Yes, take a look at the Permissions tab in Course Config.

There is an item in there for what user level is permitted to change their own email address.


In reply to Alex Jordan

Re: Can we restrict email change by user?

by Glenn Rice -
Note that Arnold's suggestion is system wide. Alex's is per course, and sets the variable Arnold mentioned in the course's simple.conf file.
In reply to Glenn Rice

Re: Can we restrict email change by user?

by L Ng -

simple.conf file is for each course correct? 

localoverrides.conf is site wide which is what i want

i’ll try it .. thanks!

In reply to L Ng

Re: Can we restrict email change by user?

by L Ng -

Arnold's suggestion works like a charm.

here is another idea.., what if we don't want anyone to change it?

is there a permission level higher than professor? or do I just create a new ROLE .. one that has a weight higher than "Professor"?

is this possible and if so, where can I define and call it?

for example, I want to call it "bigbossman" and role weight is 15

then I use "bigbossman" instead of professor ..


In reply to L Ng

Re: Can we restrict email change by user?

by Alex Jordan -

In earlier days, I found it instructive to make a setting in Course Config, and then go look at what it did in my course's simple.conf. (Which you can find in File Manager, navigating up one level from the templates/ folder that you start in.)

If you use Course Config, you can set this permission to 'nobody'. And then confirm that 'nobody' really is the actual string that is used for that setting. And then you can use that in a global config file.

Probably though, you should let admins continue to do as they see fit. So I think 'admin' is the level you are looking for, without creating a new permission level.

In reply to Alex Jordan

Re: Can we restrict email change by user?

by Danny Glin -

A couple of things to note:

The default roles and associated permission levels are defined in defaults.config:

%userRoles = (
        guest         => -5,
        student       => 0,
        login_proctor => 2,
        grade_proctor => 3,
        ta            => 5,
        professor     => 10,
        admin         => 20,
        nobody        => 99999999, # insure that nobody comes at the end
);

You don't need to add a new permission level that is above all the others, since "nobody" is already there.  Also be aware that a permission level of 15 falls below "admin", so any permissions assigned to a role with permission level 15 would be inherited by anyone with role "admin".

It looks like the nobody role was added to allow permissions to be disabled from the course configuration page.  In the global config files, the recommended way to remove a permission from all users is to undefine it, so you would use

$permissionLevels{change_email_address} = undef;