IShareProvider¶
-
interface
OCP\Share\
IShareProvider
¶ - Interface IShareProvider
Implemented by: OC\Share20\DefaultShareProvider
Source: lib/public/Share/IShareProvider.php#39
Methods¶
-
public
OCP\Share\IShareProvider::
identifier
()¶ - Return the identifier of this provider.
Source: lib/public/Share/IShareProvider.php#47 Returns: string Containing only [a-zA-Z0-9] Since: 9.0.0
-
public
OCP\Share\IShareProvider::
create
($share)¶ - Create a share
Source: Parameters: - $share (
OCP\Share\IShare
)
Returns: \OCP\Share\IShare
The share objectSince: 9.0.0
- $share (
-
public
OCP\Share\IShareProvider::
update
($share)¶ - Update a share
Source: Parameters: - $share (
OCP\Share\IShare
)
Returns: \OCP\Share\IShare
The share objectSince: 9.0.0
- $share (
-
public
OCP\Share\IShareProvider::
delete
($share)¶ - Delete a share
Source: Parameters: - $share (
OCP\Share\IShare
)
Since: 9.0.0
- $share (
-
public
OCP\Share\IShareProvider::
deleteFromSelf
($share, $recipient)¶ - Unshare a file from self as recipient.This may require special handling. If a user unshares a groupshare from their self then the original group share should still exist.
Source: Parameters: - $share (
OCP\Share\IShare
) - $recipient (string) UserId of the recipient
Since: 9.0.0
- $share (
-
public
OCP\Share\IShareProvider::
restore
($share, $recipient)¶ - Restore a share for a given recipient. The implementation could be provider independant.
Source: Parameters: - $share (
OCP\Share\IShare
) - $recipient (string)
Returns: \OCP\Share\IShare
The restored share objectSince: 14.0.0
Throws: \OCP\Share\Exceptions\GenericShareException
In case the share could not be restored - $share (
-
public
OCP\Share\IShareProvider::
move
($share, $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 sharethe target should only be changed for them.
Source: Parameters: - $share (
OCP\Share\IShare
) - $recipient (string) userId of recipient
Returns: Since: 9.0.0
- $share (
-
public
OCP\Share\IShareProvider::
getSharesInFolder
($userId, $node, $reshares)¶ - Get all shares by the given user in a folder
Source: Parameters: - $userId (string)
- $node (
OCP\Files\Folder
) - $reshares (bool) Also get the shares where $user is the owner instead of just the shares where $user is the initiator
Returns: Since: 11.0.0
-
public
OCP\Share\IShareProvider::
getSharesBy
($userId, $shareType, $node, $reshares, $limit, $offset)¶ - Get all shares by the given user
Source: Parameters: - $userId (string)
- $shareType (int)
- $node (
OCP\Files\Node
| null) - $reshares (bool) Also get the shares where $user is the owner instead of just the shares where $user is the initiator
- $limit (int) The maximum number of shares to be returned, -1 for all shares
- $offset (int)
Returns: Since: 9.0.0
-
public
OCP\Share\IShareProvider::
getShareById
($id, $recipientId=null)¶ - Get share by id
Source: Parameters: - $id (int)
- $recipientId (string | null)
Returns: Throws: Since: 9.0.0
-
public
OCP\Share\IShareProvider::
getSharesByPath
($path)¶ - Get shares for a given path
Source: Parameters: - $path (
OCP\Files\Node
)
Returns: Since: 9.0.0
- $path (
-
public
OCP\Share\IShareProvider::
getSharedWith
($userId, $shareType, $node, $limit, $offset)¶ - Get shared with the given user
Source: Parameters: - $userId (string) get shares where this user is the recipient
- $shareType (int)
- $node (
OCP\Files\Node
| null) - $limit (int) The max number of entries returned, -1 for all
- $offset (int)
Returns: Since: 9.0.0
-
public
OCP\Share\IShareProvider::
getShareByToken
($token)¶ - Get a share by token
Source: Parameters: - $token (string)
Returns: Throws: Since: 9.0.0
-
public
OCP\Share\IShareProvider::
userDeleted
($uid, $shareType)¶ - A user is deleted from the systemSo clean up the relevant shares.
Source: Parameters: - $uid (string)
- $shareType (int)
Since: 9.1.0
-
public
OCP\Share\IShareProvider::
groupDeleted
($gid)¶ - 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
Source: Parameters: - $gid (string)
Since: 9.1.0
-
public
OCP\Share\IShareProvider::
userDeletedFromGroup
($uid, $gid)¶ - A user is deleted from a groupWe have to clean up all the related user specific group sharesProviders not handling group shares should just return
Source: Parameters: - $uid (string)
- $gid (string)
Since: 9.1.0
-
public
OCP\Share\IShareProvider::
getAccessList
($nodes, $currentAccess)¶ - Get the access list to the array of provided nodes.
Source: Parameters: - $nodes (
OCP\Files\Node[]
) The list of nodes to get access for - $currentAccess (bool) If current access is required (like for removed shares that might get revived later)
See: \OCP\Share\IManager::getAccessList()
for sample docsReturns: array
Since: 12
- $nodes (
-
public
OCP\Share\IShareProvider::
getAllShares
()¶ - Get all the shares in this provider returned as iterable to reduce memoryoverhead
Source: lib/public/Share/IShareProvider.php#239 Returns: iterable
Since: 18.0.0