Continued from http://moodle.org/mod/forum/discuss.php?d=93929#p414841
And also to edit user profiles.
But they can still edit their profiles.
What am I doing wrong? I know the answer is probably easy, but I can't seem to figure this out.
Thank you, Moodlers.
And also to edit user profiles.
But they can still edit their profiles.
What am I doing wrong? I know the answer is probably easy, but I can't seem to figure this out.
Thank you, Moodlers.
Hi,
You can prevent students from updating their profiles by preventing the capability moodle/user:editownprofile (available in Moodle 1.9). Please see the demo teacher role documentation for instructions on how to apply it to selected users.
If you're not using Moodle 1.9 yet, you can lock certain profile fields via Administration > Users > Authentication, though this will apply to all users.
You can prevent students from updating their profiles by preventing the capability moodle/user:editownprofile (available in Moodle 1.9). Please see the demo teacher role documentation for instructions on how to apply it to selected users.
If you're not using Moodle 1.9 yet, you can lock certain profile fields via Administration > Users > Authentication, though this will apply to all users.
Hi,
Thanks! this actually answered my question that I posted just earlier.
Nicole
Interestingly (or should I say confusingly) moodle/user:editownprofile must be prevented in the System context. I would have guessed you could prevent it in the user's personal User context, since (conceptually) that's where the profile information lives. But user/tabs.php explicitly checks for the capability in the Sytstem context before showing the Edit tab.
That looks like a bug actually.
Let's see if the developers think so MDL-14174.
Bug reports are often the best way to learn about Moodle. MDL-14174 resolved: not a bug. Reason: "User context is used for something that you can do to other users, not yourself." (Skodak) Things that you can do to yourself are always tested in the System context.
Summary:
Summary:
- if you want to update your own profile, you need moodle/user:editownprofile in the System context. Normally everyone can update their own profile because it is allowed in Authenticated user
- if you want to update another user's profile, you need moodle/user:editprofile in the other user's personal User context.
Hmm, I don't know what I was thinking when I wrote the last paragraph above. Since the permission to edit one's own profile is calculated in the System context, you're going to have to do the preventing there. Nothing you do in a lower context (like course) is going to make a bit of difference.
So my revised advice would be to create a new role CannotEditOwnProfile with moodle/user:editownprofile = Prevent and assign it to selected users in the System context. You could also edit Auth user, but this would affect everyone, not just Students, and I wouldn't do it for that reason.
User context makes my brain hurt.
So my revised advice would be to create a new role CannotEditOwnProfile with moodle/user:editownprofile = Prevent and assign it to selected users in the System context. You could also edit Auth user, but this would affect everyone, not just Students, and I wouldn't do it for that reason.
User context makes my brain hurt.
FYI everyone, I just summarized my understanding of user context and user capabilities in another forum post. The other discussion was specifically about user context, so it is a bit more appropriate than this one.
Thank you, Helen. I have Moodle version 1.8, so I will lock certain profile fields via Administration > Users > Authentication.
I appreciate everyone's help.
The profiles are outside the courses, so changing it for the student role (normally given in a course) won't work.
You need to change it for a system-wide role like the standard Authenticated Users Role.
You need to change it for a system-wide role like the standard Authenticated Users Role.