From d97fe80e48e844833987911e4440fb95c458371a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Tue, 25 Apr 2023 22:09:33 +0200 Subject: [PATCH] Allow user to toggle visibility of the calendar of deck boards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lib/DAV/Calendar.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/DAV/Calendar.php b/lib/DAV/Calendar.php index 7e02013b5..3457e6c10 100644 --- a/lib/DAV/Calendar.php +++ b/lib/DAV/Calendar.php @@ -59,20 +59,21 @@ class Calendar extends ExternalCalendar { } 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 = [ [ 'privilege' => '{DAV:}read', 'principal' => $this->getOwner(), 'protected' => true, - ] - ]; - if ($this->backend->checkBoardPermission($this->board->getId(), Acl::PERMISSION_MANAGE)) { - $acl[] = [ + ], + [ 'privilege' => '{DAV:}write-properties', 'principal' => $this->getOwner(), 'protected' => true, - ]; - } + ] + ]; + return $acl; }