Moodle
  1. Moodle
  2. MDL-30945

add support for allowing deleting of individual user enrolments

    Details

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

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

        Issue Links

          Activity

          Hide
          Petr Škoda added a comment -

          to integrators: please cherry pick to 2.2.x, this also blocks MDL-30944 and MDL-29684

          Show
          Petr Škoda added a comment - to integrators: please cherry pick to 2.2.x, this also blocks MDL-30944 and MDL-29684
          Hide
          Eloy Lafuente (stronk7) added a comment -

          After chating a bit with Petr, there are changes to perform in the phpdocs and to clarify a bit the API, but surely that's something to do as part of the "Documenting January". So integrated (22 and master).

          Show
          Eloy Lafuente (stronk7) added a comment - After chating a bit with Petr, there are changes to perform in the phpdocs and to clarify a bit the API, but surely that's something to do as part of the "Documenting January". So integrated (22 and master).
          Hide
          Rossiani Wijaya added a comment -

          Hi Petr,

          The patch is working great except for bulk unenrolment with self enrollment plugin.

          I will wait for your comment regarding this before decided to fail/pass this issue.

          Show
          Rossiani Wijaya added a comment - Hi Petr, The patch is working great except for bulk unenrolment with self enrollment plugin. I will wait for your comment regarding this before decided to fail/pass this issue.
          Hide
          Petr Škoda added a comment -

          ah, thanks a lot, evaluating...

          Show
          Petr Škoda added a comment - ah, thanks a lot, evaluating...
          Hide
          Rossiani Wijaya added a comment -

          As explained by Petr through jabber, the bulk unenrolment of self enrol plugin was not supported on current version. That is why the functionality of bulk unerolement is not available within this patch.

          However, technically it should be possible for all plugins that allow manual unenrolment of all users.

          I'm creating new tracker to add bulk unenrolment functionality for 'self enrolment' plugin - MDL-31012.

          I'm passing this test because it works as described.

          Show
          Rossiani Wijaya added a comment - As explained by Petr through jabber, the bulk unenrolment of self enrol plugin was not supported on current version. That is why the functionality of bulk unerolement is not available within this patch. However, technically it should be possible for all plugins that allow manual unenrolment of all users. I'm creating new tracker to add bulk unenrolment functionality for 'self enrolment' plugin - MDL-31012 . I'm passing this test because it works as described.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The git and cvs repositories are happy receiving your very first contribution to Moodle for 2012. Happy new year!

          Closing, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The git and cvs repositories are happy receiving your very first contribution to Moodle for 2012. Happy new year! Closing, ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: