check if calendar is writeable

This commit is contained in:
stefan.tollkuehn committed 2026-10-08 13:20:16 +02:00
1 parent 830b53054c
commit 3be0490b68
1 file changed
+3 -1
+3 -1
View File
@@ -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;
}
}