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

add support for allowing deleting of individual user enrolments

    XMLWordPrintable

Details

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

    Description

      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);
          }

      Attachments

        Issue Links

          Activity

            People

              skodak Petr Skoda
              skodak Petr Skoda
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Rossiani Wijaya Rossiani Wijaya
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Jan/12