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

Teacher can not edit a course event in calendar unless she created it herself

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.7.2
    • Fix Version/s: None
    • Component/s: Calendar
    • Labels:
      None
    • Affected Branches:
      MOODLE_17_STABLE

      Description

      After migrating to 1.7, events that were created by one teacher, can't be edited by another. I found someting in calendar/lib.php that corrected this, but it would be great if someone double checked it...

      function: calendar_edit_event_allowed

      1183 if ($event->userid) {
      1184 if ($event->userid == $USER->id)

      { 1185 return (has_capability('moodle/calendar:manageownentries', $sitecontext)); + 1186 }

      else

      { + 1187 return has_capability( 'moodle/calendar:manageentries', get_context_instance( CONTEXT_COURSE, $event->courseid)); + 1188 }

      1189 } else if ($event->groupid) {
      1190 $group = get_record('groups', 'id', $event->groupid);
      1191 if($group === false)

      { 1192 return false; 1193 }

      It worked for me, but I can't understand why this "else" didn't exist... maybe event->userid should get there empty?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              danmarsden Dan Marsden
              Reporter:
              petcheverry Pablo Etcheverry
              Tester:
              Nobody
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: