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

add support for allowing deleting of individual user enrolments

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1, 2.2, 2.3
    • Fix Version/s: 2.2.1
    • Component/s: Enrolments
    • Labels:

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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    9/Jan/12