Moodle

No "teachers" (or corresponding role) after restore...

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7
  • Fix Version/s: 1.7
  • Component/s: Backup
  • Labels:
    None
  • Environment:
    Any
  • Database:
    Any
  • Affected Branches:
    MOODLE_17_STABLE
  • Fixed Branches:
    MOODLE_17_STABLE

Description

Hi,

After fixing MDL-6084 (for 1.6.x) I've taken a look to the corresponding code under 1.7, just to see that the expected functionality is currently deleted, so, if the user restoring the course isn't in the restore file itself, he isn't able to handle the restored course! (originally this was MDL-2381 some months ago).

So I think that something like this must be provided:

If the user restoring the course isn't a global admin (able to edit any course, not sure if this is legacy:admin or legacy:teacher at site level...) ==> assign to him editing rights on course (legacy:teacher?), obviously ONLY if such user hasn't that role yet.

Else we'll have a lot of courses restored by people that, after restore, won't be able to edit it and that seems to be a wrong behaviour.

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Ops, I forgot to assign this bug yesterday...

Show
Eloy Lafuente (stronk7) added a comment - Ops, I forgot to assign this bug yesterday...
Hide
Martin Dougiamas added a comment -

ie

if (and only if) they don't already have course:update on that new course then find a legacy:editingteacher role and assign that role to them in the course context.

Show
Martin Dougiamas added a comment - ie if (and only if) they don't already have course:update on that new course then find a legacy:editingteacher role and assign that role to them in the course context.
Hide
Yu Zhang added a comment -

Hi,

Fixed this in HEAD now. Users with restore capabilities but no manageactivities capability will be assigned a legacy:edittingteacher role upon successful restore of a course.

Show
Yu Zhang added a comment - Hi, Fixed this in HEAD now. Users with restore capabilities but no manageactivities capability will be assigned a legacy:edittingteacher role upon successful restore of a course.
Hide
A. T. Wyatt added a comment -

I just installed 1.8.2+ (2007021250). As an editing teacher (course:update is allow), I tried to restore a course, deleting it first.

At the bottom where roles are mapped, I did not have the option of keeping the teacher (to which role I already was assigned) = to editingteacher. What I had was to make the teacher = new role, non-editing teacher, student, or guest.

So I chose new role. This left me with instructor rights, but it created a copy of the editingteacher role in the admin area of define roles AND I no longer showed up as instructor in the participants list.

This doesn't seem quite right.

Show
A. T. Wyatt added a comment - I just installed 1.8.2+ (2007021250). As an editing teacher (course:update is allow), I tried to restore a course, deleting it first. At the bottom where roles are mapped, I did not have the option of keeping the teacher (to which role I already was assigned) = to editingteacher. What I had was to make the teacher = new role, non-editing teacher, student, or guest. So I chose new role. This left me with instructor rights, but it created a copy of the editingteacher role in the admin area of define roles AND I no longer showed up as instructor in the participants list. This doesn't seem quite right.
Hide
Yu Zhang added a comment -

Hi A.T.

I think this is the case because users doing restore can only map users to roles that they themselves can assign, defined in the "Allow Role Assignment" interface (Users->Permissions->Define Roles->Allow role assignment (tab)). This is to prevent say a teacher mapping students etc to Admin role or so on. The default is a bit restrictive as it does not allow editing teachers to assign other editing teachers, but you can set it to allow them to do so.

Cheers,

Yu

Show
Yu Zhang added a comment - Hi A.T. I think this is the case because users doing restore can only map users to roles that they themselves can assign, defined in the "Allow Role Assignment" interface (Users->Permissions->Define Roles->Allow role assignment (tab)). This is to prevent say a teacher mapping students etc to Admin role or so on. The default is a bit restrictive as it does not allow editing teachers to assign other editing teachers, but you can set it to allow them to do so. Cheers, Yu

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: