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

Add timestart/timeend support back to permissions code

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.9
    • 2.0
    • Roles / Access
    • None
    • MOODLE_19_STABLE
    • MOODLE_20_STABLE

    Description

      Support for timestart in the capabilities code was removed by MDL-8785 mostly for performance reasons, although there was also a complicated justification of the decision.

      IMO this behaviour is bad - it's very confusing. You set a user's enrolment to the future but they are allowed to access the site now? why? (Removing on cron is ok for the end date...) Adding and removing things in enrolment plugins may be technically possible but could be pretty difficult.

      In my opinion, if timestart is not implemented properly then it should be removed from the database.

      However, with the new queries it should probably not be a performance issue as far as I can see (they don't look that scary). I have done a patch (against 1.9 actually though probably a suitable change for that) which adds this feature back, attached. The patch applies only to functions which are normally used to check permissions, not to all the 'informational' ones (so e.g. if you get a list of the students on a course, it will still include those who 'haven't started yet', etc - they just won't be able to get in yet).

      I have not yet tested performance. Would it be worth doing so?

      Attachments

        1. roletimes.patch
          4 kB
        2. timestart.revised.patch
          11 kB
        3. timestart1.9.3+.patch.txt
          11 kB
        4. timestartHEAD.patch.txt
          11 kB
        5. timestartHEADcomplete.patch.txt
          40 kB

        Issue Links

          Activity

            People

              skodak Petr Skoda
              quen Sam Marshall
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                24/Nov/10