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

new role assignments dont take effect untill after next login of affected user

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.3
    • Fix Version/s: 1.9
    • Component/s: Roles / Access
    • Labels:
      None
    • Environment:
      win 2003 R2, iis6, mysql5, php5.2.4
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      I am still somewhat new to the roles system, but I believe that my issue is more of a bug then a feature.

      I discovered this when enrolling new students manually into a new course.

      They weren't able to attempt quizes, because this if:
      "if (has_capability('mod/quiz:attempt', $context)) " in /mod/quiz/view.php evaluated to false, even though I assigned the correct roles at both course and quiz level.

      Later I found out, that after calling the load_all_capabilities() function before the if, the student permisions were fixed, ie. updated.
      The only strange thing is that it took 2 reloads of the page to get the correct buttons displayed.
      I've also tried using load_user_capability('mod/quiz:attempt') without any noticeable effect.

      I've also noticed, that the new course wasnt displayed in their profiles immediately, so I think this problem is not limited to quiz module.

      I humbly suggest, that after asigning the roles some status variable will be set which will then trigger the load_all_capabilities() function at next page reload of the affected logged-in users, instead of the current not-so-obvious requirement of re-logging.

      Pavel

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            complicator Pavel Krejci
            Tester:
            Nicolas Martignoni
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              3/Mar/08