Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-21432 META: Backup & restore 2.0
  3. MDL-23400

api: modify get_assignable_roles() to support user param

XMLWordPrintable

    • MOODLE_20_STABLE
    • MOODLE_20_STABLE
    • Easy

      When restoring one course we need to know the roles that are assignable by a given user. That's addressed by the get_assignable_roles() function.

      The problem is that the function always returns the assignable roles for the current session user ($USER). And restore requires all permissions to be evaluated by the given user (that for sure will match $USER on interactive executions but can be different in other types of executions - cron/customs...).

      So I'm going to modify the get_assignable_roles() function, 100% BC

      • adding one new 4th parameter $user (default null)
      • if null, $USER will be used
      • if object/id, $user will be used

      Ciao

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Nobody Nobody
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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