From d142077ef1952f1eed7d2eb7fab27df78a7fa871 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Wed, 10 Oct 2007 09:03:01 +0000 Subject: [PATCH] changing CONTEXT_GROUP to CONTEXT_COURSE for calendar:manageentries capability --- calendar/event.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/calendar/event.php b/calendar/event.php index 60cae69be67..7c3450b0551 100644 --- a/calendar/event.php +++ b/calendar/event.php @@ -626,8 +626,9 @@ function calendar_add_event_allowed($event) { // to edit group calendar too // there is no need to check membership, because if you have this capability // you will have a role in this group context - return has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_GROUP, $event->groupid)); - + $group = get_record('groups', 'id', $event->groupid); + //return has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_GROUP, $event->groupid)); + return has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_COURSE, $group->courseid)); case 'user': if ($event->userid == $USER->id) { return (has_capability('moodle/calendar:manageownentries', $sitecontext));