Allow user to toggle visibility of the calendar of deck boards

The calendar object needs to be exposed with "write" properties in order to allow users to hide/show the corresponding calendar in the calendar app. It doesn't has any affects on the general permissions for the whole board or the tasks. As soon as you select a task you jump to the deck app where the normal deck permissions are applied.

fixes: https://github.com/nextcloud/deck/issues/4618

Signed-off-by: Björn Schießle <bjoern@nextcloud.com>
This commit is contained in:
Björn Schießle
2023-04-25 22:09:33 +02:00
committed by backportbot-nextcloud[bot]
parent 88b4fd0756
commit d97fe80e48

View File

@@ -59,20 +59,21 @@ class Calendar extends ExternalCalendar {
} }
public function getACL() { public function getACL() {
// the calendar should always have the read and the write-properties permissions
// write-properties is needed to allow the user to toggle the visibility of shared deck calendars
$acl = [ $acl = [
[ [
'privilege' => '{DAV:}read', 'privilege' => '{DAV:}read',
'principal' => $this->getOwner(), 'principal' => $this->getOwner(),
'protected' => true, 'protected' => true,
] ],
]; [
if ($this->backend->checkBoardPermission($this->board->getId(), Acl::PERMISSION_MANAGE)) {
$acl[] = [
'privilege' => '{DAV:}write-properties', 'privilege' => '{DAV:}write-properties',
'principal' => $this->getOwner(), 'principal' => $this->getOwner(),
'protected' => true, 'protected' => true,
]; ]
} ];
return $acl; return $acl;
} }