summaryrefslogtreecommitdiffstats
path: root/lib/public/Share
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/Share')
-rw-r--r--lib/public/Share/IManager.php15
-rw-r--r--lib/public/Share/IShareProvider.php14
2 files changed, 29 insertions, 0 deletions
diff --git a/lib/public/Share/IManager.php b/lib/public/Share/IManager.php
index 493db5e5149..56e35f517c1 100644
--- a/lib/public/Share/IManager.php
+++ b/lib/public/Share/IManager.php
@@ -29,6 +29,7 @@ namespace OCP\Share;
use OCP\Files\Folder;
use OCP\Files\Node;
+use OCP\Share\Exceptions\GenericShareException;
use OCP\Share\Exceptions\ShareNotFound;
/**
@@ -84,6 +85,20 @@ interface IManager {
public function deleteFromSelf(IShare $share, $recipientId);
/**
+ * Restore the share when it has been deleted
+ * Certain share types can be restored when they have been deleted
+ * but the provider should properly handle this\
+ *
+ * @param IShare $share The share to restore
+ * @param string $recipientId The user to restore the share for
+ * @return IShare The restored share object
+ * @throws GenericShareException In case restoring the share failed
+ *
+ * @since 14.0.0
+ */
+ public function restoreShare(IShare $share, string $recipientId): IShare;
+
+ /**
* Move the share as a recipient of the share.
* This is updating the share target. So where the recipient has the share mounted.
*
diff --git a/lib/public/Share/IShareProvider.php b/lib/public/Share/IShareProvider.php
index 4a1ac9b8b8d..6731bf8882b 100644
--- a/lib/public/Share/IShareProvider.php
+++ b/lib/public/Share/IShareProvider.php
@@ -25,6 +25,8 @@
namespace OCP\Share;
use OCP\Files\Folder;
+use OCP\Share\Exceptions\GenericShareException;
+use OCP\Share\Exceptions\ShareNotFound;
use OCP\Files\Node;
/**
@@ -81,6 +83,18 @@ interface IShareProvider {
public function deleteFromSelf(\OCP\Share\IShare $share, $recipient);
/**
+ * Restore a share for a given recipient. The implementation could be provider independant.
+ *
+ * @param IShare $share
+ * @param string $recipient
+ * @return IShare The restored share object
+ *
+ * @since 14.0.0
+ * @throws GenericShareException In case the share could not be restored
+ */
+ public function restore(IShare $share, string $recipient): IShare;
+
+ /**
* Move a share as a recipient.
* This is updating the share target. Thus the mount point of the recipient.
* This may require special handling. If a user moves a group share