check if calendar is writeable
This commit is contained in:
1 parent
830b53054c
commit
3be0490b68
1 file changed
+3
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user