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

add support for allowing deleting of individual user enrolments

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.2.1
    • 2.1, 2.2, 2.3
    • Enrolments

      At present have a method

          /**
           * Does this plugin allow manual unenrolments?
           *
           * @param stdClass $instance course enrol instance
           * All plugins allowing this must implement 'enrol/xxx:unenrol' capability
           *
           * @return bool - true means user with 'enrol/xxx:unenrol' may unenrol others freely, trues means nobody may touch user_enrolments
           */
          public function allow_unenrol(stdClass $instance) {
              return false;
          }

      I would like to add new similar method which is aimed at one user enrolment only:

       
          /**
           * Does this plugin allow manual unenrolment of a specific user?
           * All plugins allowing this must implement 'enrol/xxx:unenrol' capability
           *
           * This is useful especially for synchronisation plugins that
           * do suspend instead of full unenrolment.
           *
           * @param stdClass $instance course enrol instance
           * @param stdClass $ue record from user_enrolments table
           *
           * @return bool - true means user with 'enrol/xxx:unenrol' may unenrol this user, false means nobody may touch this user enrolment
           */
          public function allow_unenrol_user(stdClass $instance, stdClass $ue) {
              return $this->allow_unenrol($instance);
          }

            skodak Petr Skoda
            skodak Petr Skoda
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Rossiani Wijaya Rossiani Wijaya
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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