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

Allow users with privs to unenrol from imsenterprise

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.5.2
    • Fix Version/s: None
    • Component/s: Enrolments
    • Labels:
    • Affected Branches:
      MOODLE_35_STABLE

      Description

      At the moment, imsenterprise enrolled users cannot be manually unenrolled e.g. via the UI or by script (e.g. Moosh). I'd like to give this ability to siteadmins so that we can do course resets (unenrolling users) after we no longer update the imsenterprise input (e.g. previous terms/years).

      enrolimsenterpriselib.php

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

      enrolimsenterprisedbaccess.php

          /* Unenrol anybody (including self) - requires allowmodifications enabled */
          'enrol/imsenterprise:unenrol' => array(
              'captype' => 'write',
              'contextlevel' => CONTEXT_COURSE,
              'archetypes' => array(
              )
          ),
      

      Implementing this requires we bump the imsenrolment plugin version.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mwebster Mark van Hoek
              Participants:
              Component watchers:
              Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: