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

restore_backup.php doesn't set $USER in any way (should be the main admin) which can lead to permission problems

XMLWordPrintable

    • MOODLE_401_STABLE

      Using the CLI script admin/cli/restore_backup.php led to this error:

       

      Default exception handler: Fehler: Sie haben aktuell kein Recht, den Termin zu aktualisieren. Debug:Error code: generalexceptionmessage* line 106 of /admin/cli/restore_backup.php: moodle_exception thrown
      !!! Fehler: Sie haben aktuell kein Recht, den Termin zu aktualisieren. !!!

      Which basically means a permission was checked and the user is not able to continue the restore. In this case the reason for the error is the mod_zoom plugin which creates the calendar events upon restore without telling Moodle to not check for capabilities (see https://github.com/ncstate-delta/moodle-mod_zoom/blob/c7dba4307c31ccf894914e46aca184d77ea6492b/lib.php#L553)

      But it seems the more reasonable method to prevent something like this in the future would be to setup the main admin user as $USER in the restore_backup.php script.

      Or would this lead to other problems with artifact ownership or something else?

       

            Unassigned Unassigned
            poggenpohlda Daniel Poggenpohl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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