Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29072

Importing into a course requires incorrect capability on the source course

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.0.5, 2.1.2
    • 2.0.4, 2.1.1, 2.2
    • Backup
    • MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_20_STABLE, MOODLE_21_STABLE
    • Hide

      Give the capability moodle/restore:restorecourse globally to any user who needs to import course material.

      Show
      Give the capability moodle/restore:restorecourse globally to any user who needs to import course material.
    • Hide

      On a Moodle installation (21_STABLE) in standard setup:

      • Create two courses, called "source" and "target". Create some labels in "source" (as example content).
      • On "source", allow the following capabilities for the non-editing teacher role:
        o moodle/backup:backupcourse
        o moodle/backup:configure
        o moodle/backup:backuptargetimport
      • Create a user "U" and enrol the user as follows:
        o into "source" as non-editing teacher,
        o into "target" as editing teacher.
      • Log in as "U".
      • Go to "target" and click on "Import".

      Verify that the course "source" appears in the list. Select "source" and proceed with the import.

      Show
      On a Moodle installation (21_STABLE) in standard setup: Create two courses, called "source" and "target". Create some labels in "source" (as example content). On "source", allow the following capabilities for the non-editing teacher role: o moodle/backup:backupcourse o moodle/backup:configure o moodle/backup:backuptargetimport Create a user "U" and enrol the user as follows: o into "source" as non-editing teacher, o into "target" as editing teacher. Log in as "U". Go to "target" and click on "Import". Verify that the course "source" appears in the list. Select "source" and proceed with the import.

      At the moment, a user cannot import course contents from course A into course B unless he has the capability moodle/restore:restorecourse in the context of the source course.

      However, according to MDL-24518, this should be controlled by the capability moodle/backup:backuptargetimport .

      To reproduce, on a Moodle installation in standard setup:

      • Create two courses, called "source" and "target". Create some labels in "source" (as example content).
      • On "source", allow the following capabilities for the non-editing teacher role:
        • moodle/backup:backupcourse
        • moodle/backup:configure
        • moodle/backup:backuptargetimport
      • Create a user "U" and enrol the user as follows:
        • into "source" as non-editing teacher,
        • into "target" as editing teacher.
      • Log in as "U".
      • Go to "target" and click on "Import".

      EXPECTED: The list of courses displayed contains the course "source".
      ACTUAL: The list of courses displayed contains only the course "target".

      The underlying problem is that the list is filtered by courses on which the user "U" has the capability moodle/restore:restorecourse . This is done in the constructor of class import_course_search, which is inherited without modification from class restore_course_search.

      Patch will follow.

            bostelm Henning Bostelmann
            bostelm Henning Bostelmann
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Sam Hemelryk Sam Hemelryk
            Andrew Davis Andrew Davis
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.