MDL-18335 calendar event: fixed role capability checking to create new event
This commit is contained in:
@@ -1552,6 +1552,7 @@ function calendar_get_allowed_types(&$allowed, $course = null) {
|
||||
}
|
||||
if ($course->id != SITEID) {
|
||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
$allowed->user = has_capability('moodle/calendar:manageownentries', $coursecontext);
|
||||
|
||||
if (has_capability('moodle/calendar:manageentries', $coursecontext)) {
|
||||
$allowed->courses = array($course->id => 1);
|
||||
|
||||
Reference in New Issue
Block a user