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

has_capability() ignored default roles for $userid and does not detect $USER change

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.7.1
    • Fix Version/s: 1.8
    • Component/s: Roles / Access
    • Labels:
      None
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE

      Description

      While trying to fix forum cron I have discovered that has_capability() does not work properly
      1/ if you specifiy $userid default roles (guest and default user role) are ignored
      2/ if you change $USER on the fly the capcache returns incorrect results (I need this for forum cron)
      3/ it does not work on pages with $nomoodlecookie (I need this for cron improvements)

      I have prepared a patch and did some extensive testing, going to commit it today. The patch for cron, chat and forum is close to completion too - will file a new report for it.

      They changes are not small, I am not working backport for 1.7.x

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                skodak Petr Skoda
                Reporter:
                skodak Petr Skoda
                Tester:
                Nobody
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  31/Mar/07