From 3be0490b683791538884b778f0c5a7ad3b1f0499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Tollk=C3=BChn?= Date: Thu, 8 Oct 2026 13:20:16 +0200 Subject: [PATCH] check if calendar is writeable --- lib/Controller/CalendarController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Controller/CalendarController.php b/lib/Controller/CalendarController.php index 461bb47..b029587 100644 --- a/lib/Controller/CalendarController.php +++ b/lib/Controller/CalendarController.php @@ -12,6 +12,7 @@ use OCP\AppFramework\Http\RedirectResponse; use OCP\AppFramework\Http\TemplateResponse; use OCP\Calendar\ICreateFromString; use OCP\Calendar\IManager; +use OCP\Constansts; use OCP\IRequest; use OCP\IURLGenerator; use OCP\IUserSession; @@ -199,7 +200,8 @@ class CalendarController extends Controller $writable = []; foreach ($calendars as $calendar) { - if ($calendar instanceof ICreateFromString) { + if ($calendar instanceof ICreateFromString + && ($calendar->getPermissions() & Constants::PERMISSION_CREATE) !== 0) { $writable[] = $calendar; } }