From bac1651380f8330a5660d44d098f427f1cef8b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 8 Dec 2020 12:56:54 +0100 Subject: [PATCH] Handle deck share type in audit and dav app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/admin_audit/lib/Actions/Sharing.php | 25 +++++++++++++++++++ apps/dav/lib/Connector/Sabre/SharesPlugin.php | 1 + .../unit/Connector/Sabre/SharesPluginTest.php | 1 + 3 files changed, 27 insertions(+) diff --git a/apps/admin_audit/lib/Actions/Sharing.php b/apps/admin_audit/lib/Actions/Sharing.php index 2c28660a56..cab02ab188 100644 --- a/apps/admin_audit/lib/Actions/Sharing.php +++ b/apps/admin_audit/lib/Actions/Sharing.php @@ -146,6 +146,19 @@ class Sharing extends Action { 'id', ] ); + } elseif ($params['shareType'] === IShare::TYPE_DECK) { + $this->log( + 'The %s "%s" with ID "%s" has been shared to the deck card "%s" with permissions "%s" (Share ID: %s)', + $params, + [ + 'itemType', + 'itemTarget', + 'itemSource', + 'shareWith', + 'permissions', + 'id', + ] + ); } } @@ -250,6 +263,18 @@ class Sharing extends Action { 'id', ] ); + } elseif ($params['shareType'] === IShare::TYPE_DECK) { + $this->log( + 'The %s "%s" with ID "%s" has been unshared from the deck card "%s" (Share ID: %s)', + $params, + [ + 'itemType', + 'fileTarget', + 'itemSource', + 'shareWith', + 'id', + ] + ); } } diff --git a/apps/dav/lib/Connector/Sabre/SharesPlugin.php b/apps/dav/lib/Connector/Sabre/SharesPlugin.php index 3abdf6c254..c4b8f0a462 100644 --- a/apps/dav/lib/Connector/Sabre/SharesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/SharesPlugin.php @@ -121,6 +121,7 @@ class SharesPlugin extends \Sabre\DAV\ServerPlugin { IShare::TYPE_EMAIL, IShare::TYPE_ROOM, IShare::TYPE_CIRCLE, + IShare::TYPE_DECK, ]; foreach ($requestedShareTypes as $requestedShareType) { $shares = $this->shareManager->getSharesBy( diff --git a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php index 27af0b1501..f48e652272 100644 --- a/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php +++ b/apps/dav/tests/unit/Connector/Sabre/SharesPluginTest.php @@ -276,6 +276,7 @@ class SharesPluginTest extends \Test\TestCase { [[IShare::TYPE_LINK]], [[IShare::TYPE_REMOTE]], [[IShare::TYPE_ROOM]], + [[IShare::TYPE_DECK]], [[IShare::TYPE_USER, IShare::TYPE_GROUP]], [[IShare::TYPE_USER, IShare::TYPE_GROUP, IShare::TYPE_LINK]], [[IShare::TYPE_USER, IShare::TYPE_LINK]],