From 441b81a3af61078da7ce51cdd195c5c47111998c Mon Sep 17 00:00:00 2001
From: Maxence Lange <maxence@artificial-owl.com>
Date: Thu, 2 Jan 2020 11:33:27 -0100
Subject: [PATCH] confirm resharing rights if viewer is current owner

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
---
 apps/files_sharing/lib/Controller/ShareAPIController.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index d5c14a1daf1..906eb82221b 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -1462,6 +1462,10 @@ class ShareAPIController extends OCSController {
 	 * @return bool
 	 */
 	private function hasResharingRights($viewer, $node): bool {
+		if ($viewer === $node->getOwner()->getUID()) {
+			return true;
+		}
+
 		foreach ([$node, $node->getParent()] as $node) {
 			$shares = $this->getSharesFromNode($viewer, $node, true);
 			foreach ($shares as $share) {
-- 
GitLab