migrate therinaldos.com data
Build & Deploy to DigitalOcean Space / build (push) Failing after 2m38s

This commit is contained in:
2024-05-05 15:50:45 -04:00
commit ef1ff240d4
23182 changed files with 3801898 additions and 0 deletions
@@ -0,0 +1,66 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Share\Events;
use OCP\EventDispatcher\Event;
use OCP\Share\IShare;
/**
* @since 28.0.0
*/
class BeforeShareCreatedEvent extends Event {
private ?string $error = null;
/**
* @since 28.0.0
*/
public function __construct(
private IShare $share,
) {
parent::__construct();
}
/**
* @since 28.0.0
*/
public function getShare(): IShare {
return $this->share;
}
/**
* @since 28.0.0
*/
public function setError(string $error): void {
$this->error = $error;
}
/**
* @since 28.0.0
*/
public function getError(): ?string {
return $this->error;
}
}
@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Share\Events;
use OCP\EventDispatcher\Event;
use OCP\Share\IShare;
/**
* @since 28.0.0
*/
class BeforeShareDeletedEvent extends Event {
/**
* @since 28.0.0
*/
public function __construct(
private IShare $share,
) {
parent::__construct();
}
/**
* @since 28.0.0
*/
public function getShare(): IShare {
return $this->share;
}
}
@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Share\Events;
use OCP\EventDispatcher\Event;
use OCP\Share\IShare;
/**
* @since 28.0.0
*/
class ShareAcceptedEvent extends Event {
/**
* @since 28.0.0
*/
public function __construct(
private IShare $share,
) {
parent::__construct();
}
/**
* @since 28.0.0
*/
public function getShare(): IShare {
return $this->share;
}
}
@@ -0,0 +1,53 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl>
*
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Share\Events;
use OCP\EventDispatcher\Event;
use OCP\Share\IShare;
/**
* @since 18.0.0
*/
class ShareCreatedEvent extends Event {
/** @var IShare */
private $share;
/**
* @since 18.0.0
*/
public function __construct(IShare $share) {
parent::__construct();
$this->share = $share;
}
/**
* @since 18.0.0
*/
public function getShare(): IShare {
return $this->share;
}
}
@@ -0,0 +1,59 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2020, Maxence Lange <maxence@artificial-owl.com>
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Share\Events;
use OCP\EventDispatcher\Event;
use OCP\Share\IShare;
/**
* @since 21.0.0
*/
class ShareDeletedEvent extends Event {
/** @var IShare */
private $share;
/**
*
* @param IShare $share
* @param IShare[] $children
*
* @since 21.0.0
*/
public function __construct(IShare $share) {
parent::__construct();
$this->share = $share;
}
/**
* @return IShare
* @since 21.0.0
*/
public function getShare(): IShare {
return $this->share;
}
}
@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2023 Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Share\Events;
use OCP\EventDispatcher\Event;
use OCP\Share\IShare;
/**
* @since 28.0.0
*/
class ShareDeletedFromSelfEvent extends Event {
/**
* @since 28.0.0
*/
public function __construct(
private IShare $share,
) {
parent::__construct();
}
/**
* @since 28.0.0
*/
public function getShare(): IShare {
return $this->share;
}
}
@@ -0,0 +1,83 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2020, Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Share\Events;
use OC\Files\View;
use OCP\EventDispatcher\Event;
use OCP\Share\IShare;
/**
* @since 19.0.0
*/
class VerifyMountPointEvent extends Event {
/** @var IShare */
private $share;
/** @var View */
private $view;
/** @var string */
private $parent;
/**
* @since 19.0.0
*/
public function __construct(IShare $share,
View $view,
string $parent) {
parent::__construct();
$this->share = $share;
$this->view = $view;
$this->parent = $parent;
}
/**
* @since 19.0.0
*/
public function getShare(): IShare {
return $this->share;
}
/**
* @since 19.0.0
*/
public function getView(): View {
return $this->view;
}
/**
* @since 19.0.0
*/
public function getParent(): string {
return $this->parent;
}
/**
* @since 19.0.0
*/
public function setParent(string $parent): void {
$this->parent = $parent;
}
}
@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2021 Robin Appelman <robin@icewind.nl>
*
* @author Robin Appelman <robin@icewind.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Share\Exceptions;
use OCP\Share\IShare;
/**
* @since 22.0.0
*/
class AlreadySharedException extends GenericShareException {
/** @var IShare */
private $existingShare;
/**
* @since 22.0.0
*/
public function __construct(string $message, IShare $existingShare) {
parent::__construct($message);
$this->existingShare = $existingShare;
}
/**
* @since 22.0.0
*/
public function getExistingShare(): IShare {
return $this->existingShare;
}
}
@@ -0,0 +1,48 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Jan-Christoph Borchardt <hey@jancborchardt.net>
* @author Lukas Reschke <lukas@statuscode.ch>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCP\Share\Exceptions;
use OCP\HintException;
/**
* Class GenericEncryptionException
*
* @since 9.0.0
*/
class GenericShareException extends HintException {
/**
* @param string $message
* @param string $hint
* @param int $code
* @param \Exception|null $previous
* @since 9.0.0
*/
public function __construct($message = '', $hint = '', $code = 0, \Exception $previous = null) {
if (empty($message)) {
$message = 'There was an error retrieving the share. Maybe the link is wrong, it was unshared, or it was deleted.';
}
parent::__construct($message, $hint, $code, $previous);
}
}
@@ -0,0 +1,30 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCP\Share\Exceptions;
/**
* Exception for illegal attempts to modify an id of a share
* @since 9.1.0
*/
class IllegalIDChangeException extends GenericShareException {
}
@@ -0,0 +1,43 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCP\Share\Exceptions;
/**
* Class ShareNotFound
*
* @since 9.0.0
*/
class ShareNotFound extends GenericShareException {
/**
* @param string $message
* @param string $hint
* @param int $code
* @param \Exception|null $previous
* @since 9.0.0
*/
public function __construct($message = '', ...$arguments) {
if (empty($message)) {
$message = 'Share not found';
}
parent::__construct($message, ...$arguments);
}
}
@@ -0,0 +1,67 @@
<?php
/**
* @author Piotr Mrowczynski <piotr@owncloud.com>
*
* @copyright Copyright (c) 2019, ownCloud GmbH
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCP\Share;
/**
* Interface IAttributes
*
* @package OCP\Share
* @since 25.0.0
*/
interface IAttributes {
/**
* Sets an attribute enabled/disabled. If the key did not exist before it will be created.
*
* @param string $scope scope
* @param string $key key
* @param bool $enabled enabled
* @return IAttributes The modified object
* @since 25.0.0
*/
public function setAttribute($scope, $key, $enabled);
/**
* Returns if attribute is enabled/disabled for given scope id and key.
* If attribute does not exist, returns null
*
* @param string $scope scope
* @param string $key key
* @return bool|null
* @since 25.0.0
*/
public function getAttribute($scope, $key);
/**
* Formats the IAttributes object to array with the following format:
* [
* 0 => [
* "scope" => <string>,
* "key" => <string>,
* "enabled" => <bool>
* ],
* ...
* ]
*
* @return array formatted IAttributes
* @since 25.0.0
*/
public function toArray();
}
+532
View File
@@ -0,0 +1,532 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
* @author Daniel Calviño Sánchez <danxuliu@gmail.com>
* @author Joas Schilling <coding@schilljs.com>
* @author John Molakvoæ <skjnldsv@protonmail.com>
* @author Julius Härtl <jus@bitgrid.net>
* @author Lukas Reschke <lukas@statuscode.ch>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCP\Share;
use OCP\Files\Folder;
use OCP\Files\Node;
use OCP\IUser;
use OCP\Share\Exceptions\GenericShareException;
use OCP\Share\Exceptions\ShareNotFound;
/**
* This interface allows to manage sharing files between users and groups.
*
* This interface must not be implemented in your application but
* instead should be used as a service and injected in your code with
* dependency injection.
*
* @since 9.0.0
*/
interface IManager {
/**
* Create a Share
*
* @param IShare $share
* @return IShare The share object
* @throws \Exception
* @since 9.0.0
*/
public function createShare(IShare $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
* The state can't be changed this way: use acceptShare
*
* @param IShare $share
* @return IShare The share object
* @throws \InvalidArgumentException
* @since 9.0.0
*/
public function updateShare(IShare $share);
/**
* Accept a share.
*
* @param IShare $share
* @param string $recipientId
* @return IShare The share object
* @throws \InvalidArgumentException
* @since 18.0.0
*/
public function acceptShare(IShare $share, string $recipientId): IShare;
/**
* Delete a share
*
* @param IShare $share
* @throws ShareNotFound
* @throws \InvalidArgumentException
* @since 9.0.0
*/
public function deleteShare(IShare $share);
/**
* Unshare a file as the recipient.
* This can be different from a regular delete for example when one of
* the users in a groups deletes that share. But the provider should
* handle this.
*
* @param IShare $share
* @param string $recipientId
* @since 9.0.0
*/
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.
*
* @param IShare $share
* @param string $recipientId
* @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, $recipientId);
/**
* Get all shares shared by (initiated) by the provided user in a folder.
*
* @param string $userId
* @param Folder $node
* @param bool $reshares
* @param bool $shallow Whether the method should stop at the first level, or look into sub-folders.
* @return IShare[][] [$fileId => IShare[], ...]
* @since 11.0.0
*/
public function getSharesInFolder($userId, Folder $node, $reshares = false, $shallow = true);
/**
* Get shares shared by (initiated) by the provided user.
*
* @param string $userId
* @param int $shareType
* @param Node|null $path
* @param bool $reshares
* @param int $limit The maximum number of returned results, -1 for all results
* @param int $offset
* @return IShare[]
* @since 9.0.0
*/
public function getSharesBy($userId, $shareType, $path = null, $reshares = false, $limit = 50, $offset = 0);
/**
* Get shares shared with $user.
* Filter by $node if provided
*
* @param string $userId
* @param int $shareType
* @param Node|null $node
* @param int $limit The maximum number of shares returned, -1 for all
* @param int $offset
* @return IShare[]
* @since 9.0.0
*/
public function getSharedWith($userId, $shareType, $node = null, $limit = 50, $offset = 0);
/**
* Get deleted shares shared with $user.
* Filter by $node if provided
*
* @param string $userId
* @param int $shareType
* @param Node|null $node
* @param int $limit The maximum number of shares returned, -1 for all
* @param int $offset
* @return IShare[]
* @since 14.0.0
*/
public function getDeletedSharedWith($userId, $shareType, $node = null, $limit = 50, $offset = 0);
/**
* Retrieve a share by the share id.
* If the recipient is set make sure to retrieve the file for that user.
* This makes sure that if a user has moved/deleted a group share this
* is reflected.
*
* @param string $id
* @param string|null $recipient userID of the recipient
* @return IShare
* @throws ShareNotFound
* @since 9.0.0
*/
public function getShareById($id, $recipient = null);
/**
* Get the share by token possible with password
*
* @param string $token
* @return IShare
* @throws ShareNotFound
* @since 9.0.0
*/
public function getShareByToken($token);
/**
* Verify the password of a public share
*
* @param IShare $share
* @param ?string $password
* @return bool
* @since 9.0.0
*/
public function checkPassword(IShare $share, $password);
/**
* The user with UID is deleted.
* All share providers have to cleanup the shares with this user as well
* as shares owned by this user.
* Shares only initiated by this user are fine.
*
* @param string $uid
* @since 9.1.0
*/
public function userDeleted($uid);
/**
* The group with $gid is deleted
* We need to clear up all shares to this group
*
* @param string $gid
* @since 9.1.0
*/
public function groupDeleted($gid);
/**
* The user $uid is deleted from the group $gid
* All user specific group shares have to be removed
*
* @param string $uid
* @param string $gid
* @since 9.1.0
*/
public function userDeletedFromGroup($uid, $gid);
/**
* Get access list to a path. This means
* all the users that can access a given path.
*
* Consider:
* -root
* |-folder1 (23)
* |-folder2 (32)
* |-fileA (42)
*
* fileA is shared with user1 and user1@server1
* folder2 is shared with group2 (user4 is a member of group2)
* folder1 is shared with user2 (renamed to "folder (1)") and user2@server2
*
* Then the access list to '/folder1/folder2/fileA' with $currentAccess is:
* [
* users => [
* 'user1' => ['node_id' => 42, 'node_path' => '/fileA'],
* 'user4' => ['node_id' => 32, 'node_path' => '/folder2'],
* 'user2' => ['node_id' => 23, 'node_path' => '/folder (1)'],
* ],
* remote => [
* 'user1@server1' => ['node_id' => 42, 'token' => 'SeCr3t'],
* 'user2@server2' => ['node_id' => 23, 'token' => 'FooBaR'],
* ],
* public => bool
* mail => bool
* ]
*
* The access list to '/folder1/folder2/fileA' **without** $currentAccess is:
* [
* users => ['user1', 'user2', 'user4'],
* remote => bool,
* public => bool
* mail => bool
* ]
*
* This is required for encryption/activity
*
* @param \OCP\Files\Node $path
* @param bool $recursive Should we check all parent folders as well
* @param bool $currentAccess Should the user have currently access to the file
* @return array
* @since 12
*/
public function getAccessList(\OCP\Files\Node $path, $recursive = true, $currentAccess = false);
/**
* Instantiates a new share object. This is to be passed to
* createShare.
*
* @return IShare
* @since 9.0.0
*/
public function newShare();
/**
* Is the share API enabled
*
* @return bool
* @since 9.0.0
*/
public function shareApiEnabled();
/**
* Is public link sharing enabled
*
* @return bool
* @since 9.0.0
*/
public function shareApiAllowLinks();
/**
* Is password on public link requires
*
* @param bool $checkGroupMembership Check group membership exclusion
* @return bool
* @since 9.0.0
* @since 24.0.0 Added optional $checkGroupMembership parameter
*/
public function shareApiLinkEnforcePassword(bool $checkGroupMembership = true);
/**
* Is default expire date enabled
*
* @return bool
* @since 9.0.0
*/
public function shareApiLinkDefaultExpireDate();
/**
* Is default expire date enforced
*`
* @return bool
* @since 9.0.0
*/
public function shareApiLinkDefaultExpireDateEnforced();
/**
* Number of default expire days
*
* @return int
* @since 9.0.0
*/
public function shareApiLinkDefaultExpireDays();
/**
* Is default internal expire date enabled
*
* @return bool
* @since 22.0.0
*/
public function shareApiInternalDefaultExpireDate(): bool;
/**
* Is default remote expire date enabled
*
* @return bool
* @since 22.0.0
*/
public function shareApiRemoteDefaultExpireDate(): bool;
/**
* Is default expire date enforced
*
* @return bool
* @since 22.0.0
*/
public function shareApiInternalDefaultExpireDateEnforced(): bool;
/**
* Is default expire date enforced for remote shares
*
* @return bool
* @since 22.0.0
*/
public function shareApiRemoteDefaultExpireDateEnforced(): bool;
/**
* Number of default expire days
*
* @return int
* @since 22.0.0
*/
public function shareApiInternalDefaultExpireDays(): int;
/**
* Number of default expire days for remote shares
*
* @return int
* @since 22.0.0
*/
public function shareApiRemoteDefaultExpireDays(): int;
/**
* Allow public upload on link shares
*
* @return bool
* @since 9.0.0
*/
public function shareApiLinkAllowPublicUpload();
/**
* check if user can only share with group members
* @return bool
* @since 9.0.0
*/
public function shareWithGroupMembersOnly();
/**
* Check if users can share with groups
* @return bool
* @since 9.0.1
*/
public function allowGroupSharing();
/**
* Check if user enumeration is allowed
*
* @return bool
* @since 19.0.0
*/
public function allowEnumeration(): bool;
/**
* Check if user enumeration is limited to the users groups
*
* @return bool
* @since 19.0.0
*/
public function limitEnumerationToGroups(): bool;
/**
* Check if user enumeration is limited to the phonebook matches
*
* @return bool
* @since 21.0.1
*/
public function limitEnumerationToPhone(): bool;
/**
* Check if user enumeration is allowed to return on full match
*
* @return bool
* @since 21.0.1
*/
public function allowEnumerationFullMatch(): bool;
/**
* Check if the search should match the email
*
* @return bool
* @since 25.0.0
*/
public function matchEmail(): bool;
/**
* Check if the search should ignore the second in parentheses display name if there is any
*
* @return bool
* @since 25.0.0
*/
public function ignoreSecondDisplayName(): bool;
/**
* Check if the current user can enumerate the target user
*
* @param IUser|null $currentUser
* @param IUser $targetUser
* @return bool
* @since 23.0.0
*/
public function currentUserCanEnumerateTargetUser(?IUser $currentUser, IUser $targetUser): bool;
/**
* Check if sharing is disabled for the given user
*
* @param string $userId
* @return bool
* @since 9.0.0
*/
public function sharingDisabledForUser($userId);
/**
* Check if outgoing server2server shares are allowed
* @return bool
* @since 9.0.0
*/
public function outgoingServer2ServerSharesAllowed();
/**
* Check if outgoing server2server shares are allowed
* @return bool
* @since 14.0.0
*/
public function outgoingServer2ServerGroupSharesAllowed();
/**
* Check if a given share provider exists
* @param int $shareType
* @return bool
* @since 11.0.0
*/
public function shareProviderExists($shareType);
/**
* @param string $shareProviderClass
* @since 21.0.0
*/
public function registerShareProvider(string $shareProviderClass): void;
/**
* @Internal
*
* Get all the shares as iterable to reduce memory overhead
* Note, since this opens up database cursors the iterable should
* be fully itterated.
*
* @return iterable
* @since 18.0.0
*/
public function getAllShares(): iterable;
}
@@ -0,0 +1,61 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Julius Härtl <jus@bitgrid.net>
* @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCP\Share;
use OC\Share20\Exception\ProviderException;
/**
* Interface IProviderFactory
*
* @since 9.0.0
*/
interface IProviderFactory {
/**
* @param string $id
* @return IShareProvider
* @throws ProviderException
* @since 9.0.0
*/
public function getProvider($id);
/**
* @param int $shareType
* @return IShareProvider
* @throws ProviderException
* @since 9.0.0
*/
public function getProviderForType($shareType);
/**
* @return IShareProvider[]
* @since 11.0.0
*/
public function getAllProviders();
/**
* @since 21.0.0
* @param string $shareProvier
*/
public function registerProvider(string $shareProvier): void;
}
@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2023 Louis Chemineau <louis@chmn.me>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Share;
/**
* @since 26.0.0
*/
interface IPublicShareTemplateFactory {
/**
* Returns a provider that is willing to respond for given share.
* @since 26.0.0
*/
public function getProvider(IShare $share): IPublicShareTemplateProvider;
}
@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2023 Louis Chemineau <louis@chmn.me>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Share;
use OCP\AppFramework\Http\TemplateResponse;
/**
* @since 26.0.0
*/
interface IPublicShareTemplateProvider {
/**
* Returns whether the provider can respond for the given share.
* @since 26.0.0
*/
public function shouldRespond(IShare $share): bool;
/**
* Returns the a template for a given share.
* @since 26.0.0
*/
public function renderPage(IShare $share, string $token, string $path): TemplateResponse;
}
+622
View File
@@ -0,0 +1,622 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
* @author Daniel Calviño Sánchez <danxuliu@gmail.com>
* @author Joas Schilling <coding@schilljs.com>
* @author John Molakvoæ <skjnldsv@protonmail.com>
* @author Julius Härtl <jus@bitgrid.net>
* @author Maxence Lange <maxence@nextcloud.com>
* @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCP\Share;
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\Node;
use OCP\Files\NotFoundException;
use OCP\Share\Exceptions\IllegalIDChangeException;
/**
* This interface allows to represent a share object.
*
* This interface must not be implemented in your application.
*
* @since 9.0.0
*/
interface IShare {
/**
* @since 17.0.0
*/
public const TYPE_USER = 0;
/**
* @since 17.0.0
*/
public const TYPE_GROUP = 1;
/**
* @internal
* @since 18.0.0
*/
public const TYPE_USERGROUP = 2;
/**
* @since 17.0.0
*/
public const TYPE_LINK = 3;
/**
* @since 17.0.0
*/
public const TYPE_EMAIL = 4;
/**
* ToDo Check if it is still in use otherwise remove it
* @since 17.0.0
*/
// public const TYPE_CONTACT = 5;
/**
* @since 17.0.0
*/
public const TYPE_REMOTE = 6;
/**
* @since 17.0.0
*/
public const TYPE_CIRCLE = 7;
/**
* @since 17.0.0
*/
public const TYPE_GUEST = 8;
/**
* @since 17.0.0
*/
public const TYPE_REMOTE_GROUP = 9;
/**
* @since 17.0.0
*/
public const TYPE_ROOM = 10;
/**
* Internal type used by RoomShareProvider
* @since 17.0.0
*/
// const TYPE_USERROOM = 11;
/**
* @since 21.0.0
*/
public const TYPE_DECK = 12;
/**
* @internal
* @since 21.0.0
*/
public const TYPE_DECK_USER = 13;
/**
* @since 26.0.0
*/
public const TYPE_SCIENCEMESH = 15;
/**
* @since 18.0.0
*/
public const STATUS_PENDING = 0;
/**
* @since 18.0.0
*/
public const STATUS_ACCEPTED = 1;
/**
* @since 18.0.0
*/
public const STATUS_REJECTED = 2;
/**
* Set the internal id of the share
* It is only allowed to set the internal id of a share once.
* Attempts to override the internal id will result in an IllegalIDChangeException
*
* @param string $id
* @return \OCP\Share\IShare
* @throws IllegalIDChangeException
* @throws \InvalidArgumentException
* @since 9.1.0
*/
public function setId($id);
/**
* Get the internal id of the share.
*
* @return string
* @since 9.0.0
*/
public function getId();
/**
* Get the full share id. This is the <providerid>:<internalid>.
* The full id is unique in the system.
*
* @return string
* @since 9.0.0
* @throws \UnexpectedValueException If the fullId could not be constructed
*/
public function getFullId();
/**
* Set the provider id of the share
* It is only allowed to set the provider id of a share once.
* Attempts to override the provider id will result in an IllegalIDChangeException
*
* @param string $id
* @return \OCP\Share\IShare
* @throws IllegalIDChangeException
* @throws \InvalidArgumentException
* @since 9.1.0
*/
public function setProviderId($id);
/**
* Set the node of the file/folder that is shared
*
* @param Node $node
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
public function setNode(Node $node);
/**
* Get the node of the file/folder that is shared
*
* @return File|Folder
* @since 9.0.0
* @throws NotFoundException
*/
public function getNode();
/**
* Set file id for lazy evaluation of the node
* @param int $fileId
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
public function setNodeId($fileId);
/**
* Get the fileid of the node of this share
* @return int
* @since 9.0.0
* @throws NotFoundException
*/
public function getNodeId();
/**
* Set the type of node (file/folder)
*
* @param string $type
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
public function setNodeType($type);
/**
* Get the type of node (file/folder)
*
* @return string
* @since 9.0.0
* @throws NotFoundException
*/
public function getNodeType();
/**
* Set the shareType
*
* @param int $shareType
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
public function setShareType($shareType);
/**
* Get the shareType
*
* @return int
* @since 9.0.0
*/
public function getShareType();
/**
* Set the receiver of this share.
*
* @param string $sharedWith
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
public function setSharedWith($sharedWith);
/**
* Get the receiver of this share.
*
* @return string
* @since 9.0.0
*/
public function getSharedWith();
/**
* Set the display name of the receiver of this share.
*
* @param string $displayName
* @return \OCP\Share\IShare The modified object
* @since 14.0.0
*/
public function setSharedWithDisplayName($displayName);
/**
* Get the display name of the receiver of this share.
*
* @return string
* @since 14.0.0
*/
public function getSharedWithDisplayName();
/**
* Set the avatar of the receiver of this share.
*
* @param string $src
* @return \OCP\Share\IShare The modified object
* @since 14.0.0
*/
public function setSharedWithAvatar($src);
/**
* Get the avatar of the receiver of this share.
*
* @return string
* @since 14.0.0
*/
public function getSharedWithAvatar();
/**
* Set the permissions.
* See \OCP\Constants::PERMISSION_*
*
* @param int $permissions
* @return IShare The modified object
* @since 9.0.0
*/
public function setPermissions($permissions);
/**
* Get the share permissions
* See \OCP\Constants::PERMISSION_*
*
* @return int
* @since 9.0.0
*/
public function getPermissions();
/**
* Create share attributes object
*
* @since 25.0.0
* @return IAttributes
*/
public function newAttributes(): IAttributes;
/**
* Set share attributes
*
* @param ?IAttributes $attributes
* @since 25.0.0
* @return IShare The modified object
*/
public function setAttributes(?IAttributes $attributes);
/**
* Get share attributes
*
* @since 25.0.0
* @return ?IAttributes
*/
public function getAttributes(): ?IAttributes;
/**
* Set the accepted status
* See self::STATUS_*
*
* @param int $status
* @return IShare The modified object
* @since 18.0.0
*/
public function setStatus(int $status): IShare;
/**
* Get the accepted status
* See self::STATUS_*
*
* @return int
* @since 18.0.0
*/
public function getStatus(): int;
/**
* Attach a note to a share
*
* @param string $note
* @return \OCP\Share\IShare The modified object
* @since 14.0.0
*/
public function setNote($note);
/**
* Get note attached to a share
*
* @return string
* @since 14.0.0
*/
public function getNote();
/**
* Set the expiration date
*
* @param null|\DateTime $expireDate
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
public function setExpirationDate($expireDate);
/**
* Get the expiration date
*
* @return null|\DateTime
* @since 9.0.0
*/
public function getExpirationDate();
/**
* Is the share expired ?
*
* @return boolean
* @since 18.0.0
*/
public function isExpired();
/**
* set a label for a share, some shares, e.g. public links can have a label
*
* @param string $label
* @return \OCP\Share\IShare The modified object
* @since 15.0.0
*/
public function setLabel($label);
/**
* get label for the share, some shares, e.g. public links can have a label
*
* @return string
* @since 15.0.0
*/
public function getLabel();
/**
* Set the sharer of the path.
*
* @param string $sharedBy
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
public function setSharedBy($sharedBy);
/**
* Get share sharer
*
* @return string
* @since 9.0.0
*/
public function getSharedBy();
/**
* Set the original share owner (who owns the path that is shared)
*
* @param string $shareOwner
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
public function setShareOwner($shareOwner);
/**
* Get the original share owner (who owns the path that is shared)
*
* @return string
* @since 9.0.0
*/
public function getShareOwner();
/**
* Set the password for this share.
* When the share is passed to the share manager to be created
* or updated the password will be hashed.
*
* @param string|null $password
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
public function setPassword($password);
/**
* Get the password of this share.
* If this share is obtained via a shareprovider the password is
* hashed.
*
* @return string
* @since 9.0.0
*/
public function getPassword();
/**
* Set the password's expiration time of this share.
*
* @return self The modified object
* @since 24.0.0
*/
public function setPasswordExpirationTime(?\DateTimeInterface $passwordExpirationTime = null): IShare;
/**
* Get the password's expiration time of this share.
* @since 24.0.0
*/
public function getPasswordExpirationTime(): ?\DateTimeInterface;
/**
* Set if the recipient can start a conversation with the owner to get the
* password using Nextcloud Talk.
*
* @param bool $sendPasswordByTalk
* @return \OCP\Share\IShare The modified object
* @since 14.0.0
*/
public function setSendPasswordByTalk(bool $sendPasswordByTalk);
/**
* Get if the recipient can start a conversation with the owner to get the
* password using Nextcloud Talk.
* The returned value does not take into account other factors, like Talk
* being enabled for the owner of the share or not; it just cover whether
* the option is enabled for the share itself or not.
*
* @return bool
* @since 14.0.0
*/
public function getSendPasswordByTalk(): bool;
/**
* Set the public link token.
*
* @param string $token
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
public function setToken($token);
/**
* Get the public link token.
*
* @return string
* @since 9.0.0
*/
public function getToken();
/**
* Set the target path of this share relative to the recipients user folder.
*
* @param string $target
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
public function setTarget($target);
/**
* Get the target path of this share relative to the recipients user folder.
*
* @return string
* @since 9.0.0
*/
public function getTarget();
/**
* Set the time this share was created
*
* @param \DateTime $shareTime
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
public function setShareTime(\DateTime $shareTime);
/**
* Get the timestamp this share was created
*
* @return \DateTime
* @since 9.0.0
*/
public function getShareTime();
/**
* Set if the recipient is informed by mail about the share.
*
* @param bool $mailSend
* @return \OCP\Share\IShare The modified object
* @since 9.0.0
*/
public function setMailSend($mailSend);
/**
* Get if the recipient informed by mail about the share.
*
* @return bool
* @since 9.0.0
*/
public function getMailSend();
/**
* Set the cache entry for the shared node
*
* @param ICacheEntry $entry
* @since 11.0.0
*/
public function setNodeCacheEntry(ICacheEntry $entry);
/**
* Get the cache entry for the shared node
*
* @return null|ICacheEntry
* @since 11.0.0
*/
public function getNodeCacheEntry();
/**
* Sets a shares hide download state
* This is mainly for public shares. It will signal that the share page should
* hide download buttons etc.
*
* @param bool $hide
* @return IShare
* @since 15.0.0
*/
public function setHideDownload(bool $hide): IShare;
/**
* Gets a shares hide download state
* This is mainly for public shares. It will signal that the share page should
* hide download buttons etc.
*
* @return bool
* @since 15.0.0
*/
public function getHideDownload(): bool;
}
@@ -0,0 +1,40 @@
<?php
/**
* @copyright 2017, Roeland Jago Douma <roeland@famdouma.nl>
*
* @author Joas Schilling <coding@schilljs.com>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP\Share;
use OCP\Files\Node;
/**
* Interface IShareHelper
*
* @since 12
*/
interface IShareHelper {
/**
* @param Node $node
* @return array [ users => [Mapping $uid => $pathForUser], remotes => [Mapping $cloudId => $pathToMountRoot]]
* @since 12
*/
public function getPathsForAccessList(Node $node);
}
@@ -0,0 +1,239 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
* @author Bjoern Schiessle <bjoern@schiessle.org>
* @author Daniel Calviño Sánchez <danxuliu@gmail.com>
* @author Joas Schilling <coding@schilljs.com>
* @author Robin Appelman <robin@icewind.nl>
* @author Roeland Jago Douma <roeland@famdouma.nl>
*
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCP\Share;
use OCP\Files\Folder;
use OCP\Files\Node;
use OCP\Share\Exceptions\GenericShareException;
use OCP\Share\Exceptions\ShareNotFound;
/**
* Interface IShareProvider
*
* @since 9.0.0
*/
interface IShareProvider {
/**
* Return the identifier of this provider.
*
* @return string Containing only [a-zA-Z0-9]
* @since 9.0.0
*/
public function identifier();
/**
* Create a share
*
* @param \OCP\Share\IShare $share
* @return \OCP\Share\IShare The share object
* @since 9.0.0
*/
public function create(\OCP\Share\IShare $share);
/**
* Update a share
*
* @param \OCP\Share\IShare $share
* @return \OCP\Share\IShare The share object
* @since 9.0.0
*/
public function update(\OCP\Share\IShare $share);
/**
* Accept a share.
*
* @param IShare $share
* @param string $recipient
* @return IShare The share object
* @since 17.0.0
*/
// public function acceptShare(IShare $share, string $recipient): IShare;
/**
* Delete a share
*
* @param \OCP\Share\IShare $share
* @since 9.0.0
*/
public function delete(\OCP\Share\IShare $share);
/**
* Unshare a file from self as recipient.
* This may require special handling. If a user unshares a group
* share from their self then the original group share should still exist.
*
* @param \OCP\Share\IShare $share
* @param string $recipient UserId of the recipient
* @since 9.0.0
*/
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
* the target should only be changed for them.
*
* @param \OCP\Share\IShare $share
* @param string $recipient userId of recipient
* @return \OCP\Share\IShare
* @since 9.0.0
*/
public function move(\OCP\Share\IShare $share, $recipient);
/**
* Get all shares by the given user in a folder
*
* @param string $userId
* @param Folder $node
* @param bool $reshares Also get the shares where $user is the owner instead of just the shares where $user is the initiator
* @param bool $shallow Whether the method should stop at the first level, or look into sub-folders.
* @return \OCP\Share\IShare[][]
* @since 11.0.0
*/
public function getSharesInFolder($userId, Folder $node, $reshares, $shallow = true);
/**
* Get all shares by the given user
*
* @param string $userId
* @param int $shareType
* @param Node|null $node
* @param bool $reshares Also get the shares where $user is the owner instead of just the shares where $user is the initiator
* @param int $limit The maximum number of shares to be returned, -1 for all shares
* @param int $offset
* @return \OCP\Share\IShare[]
* @since 9.0.0
*/
public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offset);
/**
* Get share by id
*
* @param int $id
* @param string|null $recipientId
* @return \OCP\Share\IShare
* @throws ShareNotFound
* @since 9.0.0
*/
public function getShareById($id, $recipientId = null);
/**
* Get shares for a given path
*
* @param Node $path
* @return \OCP\Share\IShare[]
* @since 9.0.0
*/
public function getSharesByPath(Node $path);
/**
* Get shared with the given user
*
* @param string $userId get shares where this user is the recipient
* @param int $shareType
* @param Node|null $node
* @param int $limit The max number of entries returned, -1 for all
* @param int $offset
* @return \OCP\Share\IShare[]
* @since 9.0.0
*/
public function getSharedWith($userId, $shareType, $node, $limit, $offset);
/**
* Get a share by token
*
* @param string $token
* @return \OCP\Share\IShare
* @throws ShareNotFound
* @since 9.0.0
*/
public function getShareByToken($token);
/**
* A user is deleted from the system
* So clean up the relevant shares.
*
* @param string $uid
* @param int $shareType
* @since 9.1.0
*/
public function userDeleted($uid, $shareType);
/**
* A group is deleted from the system.
* We have to clean up all shares to this group.
* Providers not handling group shares should just return
*
* @param string $gid
* @since 9.1.0
*/
public function groupDeleted($gid);
/**
* A user is deleted from a group
* We have to clean up all the related user specific group shares
* Providers not handling group shares should just return
*
* @param string $uid
* @param string $gid
* @since 9.1.0
*/
public function userDeletedFromGroup($uid, $gid);
/**
* Get the access list to the array of provided nodes.
*
* @see IManager::getAccessList() for sample docs
*
* @param Node[] $nodes The list of nodes to get access for
* @param bool $currentAccess If current access is required (like for removed shares that might get revived later)
* @return array
* @since 12
*/
public function getAccessList($nodes, $currentAccess);
/**
* Get all the shares in this provider returned as iterable to reduce memory
* overhead
*
* @return iterable
* @since 18.0.0
*/
public function getAllShares(): iterable;
}