diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-01-29 10:27:39 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-02 11:34:52 +0100 |
commit | 2316cb1f8b9704621b47e6eb1c2cbf30c06c552d (patch) | |
tree | ca606e3695c30823e8967c5f875e359e5e98b4d2 /lib/public | |
parent | 8ebdfd0e05331ed557920dac915653c309424797 (diff) | |
download | nextcloud-server-2316cb1f8b9704621b47e6eb1c2cbf30c06c552d.tar.gz nextcloud-server-2316cb1f8b9704621b47e6eb1c2cbf30c06c552d.zip |
[Share 2.0] Allow moving of shares
* Only recipient can move a share
* Unit tests
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/share/imanager.php | 20 | ||||
-rw-r--r-- | lib/public/share/ishareprovider.php | 13 |
2 files changed, 30 insertions, 3 deletions
diff --git a/lib/public/share/imanager.php b/lib/public/share/imanager.php index 6919fea00de..15b9f34764e 100644 --- a/lib/public/share/imanager.php +++ b/lib/public/share/imanager.php @@ -37,13 +37,15 @@ interface IManager { * Create a Share * * @param IShare $share - * @return Share The share object + * @return IShare The share object * @since 9.0.0 */ public function createShare(IShare $share); /** - * Update a share + * Update a share. + * The target of the share can't be changed this way: use moveShare + * The share can't be removed this way (permission 0): use deleteShare * * @param IShare $share * @return IShare The share object @@ -73,6 +75,18 @@ interface IManager { public function deleteFromSelf(IShare $share, IUser $recipient); /** + * Move the share as a recipient of the share. + * This is updating the share target. So where the recipient has the share mounted. + * + * @param IShare $share + * @param IUser $recipient + * @return IShare + * @throws \InvalidArgumentException If $share is a link share or the $recipient does not match + * @since 9.0.0 + */ + public function moveShare(IShare $share, IUser $recipient); + + /** * Get shares shared by (initiated) by the provided user. * * @param IUser $user @@ -118,7 +132,7 @@ interface IManager { * Get the share by token possible with password * * @param string $token - * @return Share + * @return IShare * @throws ShareNotFound * @since 9.0.0 */ diff --git a/lib/public/share/ishareprovider.php b/lib/public/share/ishareprovider.php index 9dc56dc37ad..42a2881718e 100644 --- a/lib/public/share/ishareprovider.php +++ b/lib/public/share/ishareprovider.php @@ -80,6 +80,19 @@ interface IShareProvider { public function deleteFromSelf(\OCP\Share\IShare $share, IUser $recipient); /** + * 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 + * the target should only be changed for them. + * + * @param \OCP\Share\IShare $share + * @param IUser $recipient + * @return \OCP\Share\IShare + * @since 9.0.0 + */ + public function move(\OCP\Share\IShare $share, IUser $recipient); + + /** * Get all shares by the given user * * @param IUser $user |