Permalink
Browse files

MDL-18335 calendar event: fixed role capability checking to create ne…

…w event
  • Loading branch information...
1 parent 3978e05 commit 406db74fe867f5b5d633d77f601ad5d0f03dea96 @rwijaya rwijaya committed Apr 30, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 calendar/lib.php
View
@@ -1633,6 +1633,7 @@ function calendar_get_allowed_types(&$allowed) {
if(!empty($SESSION->cal_course_referer) && $SESSION->cal_course_referer != SITEID) {
$course = $DB->get_record('course', array('id'=>$SESSION->cal_course_referer));
$coursecontext = get_context_instance(CONTEXT_COURSE, $SESSION->cal_course_referer);
+ $allowed->user = has_capability('moodle/calendar:manageownentries', $coursecontext);
if(has_capability('moodle/calendar:manageentries', $coursecontext)) {
$allowed->courses = array($course->id => 1);

0 comments on commit 406db74

Please sign in to comment.