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

Add timestart/timeend support back to permissions code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 2.0
    • Component/s: Roles / Access
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      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

              Assignee:
              skodak Petr Skoda
              Reporter:
              quen Sam Marshall
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10