MDL-37338 Calendar: User will not see calendar subscription, which he/she can't edit
authorRajesh Taneja <rajesh@moodle.com>
Mon, 14 Jan 2013 06:29:08 +0000 (14:29 +0800)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 4 Mar 2013 00:49:02 +0000 (01:49 +0100)
Signed-off-by: Rajesh Taneja <rajesh@moodle.com>
calendar/managesubscriptions.php

index 07265bc..21782aa 100644 (file)
@@ -115,6 +115,14 @@ $PAGE->set_button(calendar_preferences_button($course));
 $renderer = $PAGE->get_renderer('core_calendar');
 
 echo $OUTPUT->header();
+
+// Filter subscriptions which user can't edit.
+foreach($subscriptions as $subscription) {
+    if (!calendar_can_edit_subscription($subscription)) {
+        unset($subscriptions[$subscription->id]);
+    }
+}
+
 // Display a table of subscriptions.
 echo $renderer->subscription_details($courseid, $subscriptions, $importresults);
 // Display the add subscription form.