IManager¶
-
interface
OCP\Share\
IManager
¶ - Interface IManager
Implemented by: OC\Share20\Manager
Source: lib/public/Share/IManager.php#44
Methods¶
-
public
OCP\Share\IManager::
createShare
($share)¶ - Create a Share
Source: Parameters: - $share (
OCP\Share\IShare
)
Returns: \OCP\Share\IShare
The share objectThrows: \Exception
Since: 9.0.0
- $share (
-
public
OCP\Share\IManager::
updateShare
($share)¶ - Update a share.The target of the share can’t be changed this way: use moveShareThe share can’t be removed this way (permission 0): use deleteShareThe state can’t be changed this way: use acceptShare
Source: Parameters: - $share (
OCP\Share\IShare
)
Returns: \OCP\Share\IShare
The share objectThrows: \InvalidArgumentException
Since: 9.0.0
- $share (
-
public
OCP\Share\IManager::
acceptShare
($share, $recipientId)¶ - Accept a share.
Source: Parameters: - $share (
OCP\Share\IShare
) - $recipientId (string)
Returns: \OCP\Share\IShare
The share objectThrows: \InvalidArgumentException
Since: 18.0.0
- $share (
-
public
OCP\Share\IManager::
deleteShare
($share)¶ - Delete a share
Source: Parameters: - $share (
OCP\Share\IShare
)
Throws: Throws: \InvalidArgumentException
Throws: Throws: \InvalidArgumentException
Since: 9.0.0
- $share (
-
public
OCP\Share\IManager::
deleteFromSelf
($share, $recipientId)¶ - Unshare a file as the recipient.This can be different from a regular delete for example when one ofthe users in a groups deletes that share. But the provider shouldhandle this.
Source: Parameters: - $share (
OCP\Share\IShare
) - $recipientId (string)
Since: 9.0.0
- $share (
-
public
OCP\Share\IManager::
restoreShare
($share, $recipientId)¶ - Restore the share when it has been deletedCertain share types can be restored when they have been deletedbut the provider should properly handle this\
Source: Parameters: - $share (
OCP\Share\IShare
) The share to restore - $recipientId (string) The user to restore the share for
Returns: \OCP\Share\IShare
The restored share objectThrows: \OCP\Share\Exceptions\GenericShareException
In case restoring the share failedSince: 14.0.0
- $share (
-
public
OCP\Share\IManager::
moveShare
($share, $recipientId)¶ - Move the share as a recipient of the share.This is updating the share target. So where the recipient has the share mounted.
Source: Parameters: - $share (
OCP\Share\IShare
) - $recipientId (string)
Returns: Throws: \InvalidArgumentException
If $share is a link share or the $recipient does not matchSince: 9.0.0
- $share (
-
public
OCP\Share\IManager::
getSharesInFolder
($userId, $node, $reshares=false)¶ - Get all shares shared by (initiated) by the provided user in a folder.
Source: Parameters: - $userId (string)
- $node (
OCP\Files\Folder
) - $reshares (bool)
Returns: \OCP\Share\IShare[][]
[$fileId => IShare[], ...]Since: 11.0.0
-
public
OCP\Share\IManager::
getSharesBy
($userId, $shareType, $path=null, $reshares=false, $limit=50, $offset=0)¶ - Get shares shared by (initiated) by the provided user.
Source: Parameters: - $userId (string)
- $shareType (int)
- $path (
OCP\Files\Node
| null) - $reshares (bool)
- $limit (int) The maximum number of returned results, -1 for all results
- $offset (int)
Returns: Since: 9.0.0
-
public
OCP\Share\IManager::
getSharedWith
($userId, $shareType, $node=null, $limit=50, $offset=0)¶ - Get shares shared with $user.Filter by $node if provided
Source: Parameters: - $userId (string)
- $shareType (int)
- $node (
OCP\Files\Node
| null) - $limit (int) The maximum number of shares returned, -1 for all
- $offset (int)
Returns: Since: 9.0.0
-
public
OCP\Share\IManager::
getDeletedSharedWith
($userId, $shareType, $node=null, $limit=50, $offset=0)¶ - Get deleted shares shared with $user.Filter by $node if provided
Source: Parameters: - $userId (string)
- $shareType (int)
- $node (
OCP\Files\Node
| null) - $limit (int) The maximum number of shares returned, -1 for all
- $offset (int)
Returns: Since: 14.0.0
-
public
OCP\Share\IManager::
getShareById
($id, $recipient=null)¶ - 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 thisis reflected.
Source: Parameters: - $id (string)
- $recipient (string | null) userID of the recipient
Returns: Throws: Since: 9.0.0
-
public
OCP\Share\IManager::
getShareByToken
($token)¶ - Get the share by token possible with password
Source: Parameters: - $token (string)
Returns: Throws: Since: 9.0.0
-
public
OCP\Share\IManager::
checkPassword
($share, $password)¶ - Verify the password of a public share
Source: Parameters: - $share (
OCP\Share\IShare
) - $password (string)
Returns: bool
Since: 9.0.0
- $share (
-
public
OCP\Share\IManager::
userDeleted
($uid)¶ - The user with UID is deleted.All share providers have to cleanup the shares with this user as wellas shares owned by this user.Shares only initiated by this user are fine.
Source: Parameters: - $uid (string)
Since: 9.1.0
-
public
OCP\Share\IManager::
groupDeleted
($gid)¶ - The group with $gid is deletedWe need to clear up all shares to this group
Source: Parameters: - $gid (string)
Since: 9.1.0
-
public
OCP\Share\IManager::
userDeletedFromGroup
($uid, $gid)¶ - The user $uid is deleted from the group $gidAll user specific group shares have to be removed
Source: Parameters: - $uid (string)
- $gid (string)
Since: 9.1.0
-
public
OCP\Share\IManager::
getAccessList
($path, $recursive=true, $currentAccess=false)¶ - Get access list to a path. This meansall the users that can access a given path.Consider:-root|-folder1 (23)|-folder2 (32)|-fileA (42)fileA is shared with user1 and user1@server1folder2 is shared with group2 (user4 is a member of group2)folder1 is shared with user2 (renamed to “folder (1)”) and user2@server2Then 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 => boolmail => bool]The access list to ‘/folder1/folder2/fileA’ **without** $currentAccess is:[users => [‘user1’, ‘user2’, ‘user4’],remote => bool,public => boolmail => bool]This is required for encryption/activity
Source: Parameters: - $path (
OCP\Files\Node
) - $recursive (bool) Should we check all parent folders as well
- $currentAccess (bool) Should the user have currently access to the file
Returns: array
Since: 12
- $path (
-
public
OCP\Share\IManager::
newShare
()¶ - Instantiates a new share object. This is to be passed tocreateShare.
Source: lib/public/Share/IManager.php#299 Returns: \OCP\Share\IShare
Since: 9.0.0
-
public
OCP\Share\IManager::
shareApiEnabled
()¶ - Is the share API enabled
Source: lib/public/Share/IManager.php#307 Returns: bool Since: 9.0.0
-
public
OCP\Share\IManager::
shareApiAllowLinks
()¶ - Is public link sharing enabled
Source: lib/public/Share/IManager.php#315 Returns: bool Since: 9.0.0
-
public
OCP\Share\IManager::
shareApiLinkEnforcePassword
()¶ - Is password on public link requires
Source: lib/public/Share/IManager.php#323 Returns: bool Since: 9.0.0
-
public
OCP\Share\IManager::
shareApiLinkDefaultExpireDate
()¶ - Is default expire date enabled
Source: lib/public/Share/IManager.php#331 Returns: bool Since: 9.0.0
-
public
OCP\Share\IManager::
shareApiLinkDefaultExpireDateEnforced
()¶ - Is default expire date enforced`
Source: lib/public/Share/IManager.php#339 Returns: bool Since: 9.0.0
-
public
OCP\Share\IManager::
shareApiLinkDefaultExpireDays
()¶ - Number of default expire days
Source: lib/public/Share/IManager.php#347 Returns: int Since: 9.0.0
-
public
OCP\Share\IManager::
shareApiLinkAllowPublicUpload
()¶ - Allow public upload on link shares
Source: lib/public/Share/IManager.php#355 Returns: bool Since: 9.0.0
-
public
OCP\Share\IManager::
shareWithGroupMembersOnly
()¶ - check if user can only share with group members
Source: lib/public/Share/IManager.php#362 Returns: bool Since: 9.0.0
-
public
OCP\Share\IManager::
allowGroupSharing
()¶ - Check if users can share with groups
Source: lib/public/Share/IManager.php#369 Returns: bool Since: 9.0.1
-
public
OCP\Share\IManager::
allowEnumeration
()¶ - Check if user enumeration is allowed
Source: lib/public/Share/IManager.php#377 Returns: bool Since: 19.0.0
-
public
OCP\Share\IManager::
limitEnumerationToGroups
()¶ - Check if user enumeration is limited to the users groups
Source: lib/public/Share/IManager.php#385 Returns: bool Since: 19.0.0
-
public
OCP\Share\IManager::
limitEnumerationToPhone
()¶ - Check if user enumeration is limited to the phonebook matches
Source: lib/public/Share/IManager.php#393 Returns: bool Since: 21.0.1
-
public
OCP\Share\IManager::
allowEnumerationFullMatch
()¶ - Check if user enumeration is allowed to return on full match
Source: lib/public/Share/IManager.php#401 Returns: bool Since: 21.0.1
-
public
OCP\Share\IManager::
sharingDisabledForUser
($userId)¶ - Check if sharing is disabled for the given user
Source: Parameters: - $userId (string)
Returns: bool
Since: 9.0.0
-
public
OCP\Share\IManager::
outgoingServer2ServerSharesAllowed
()¶ - Check if outgoing server2server shares are allowed
Source: lib/public/Share/IManager.php#417 Returns: bool Since: 9.0.0
-
public
OCP\Share\IManager::
outgoingServer2ServerGroupSharesAllowed
()¶ - Check if outgoing server2server shares are allowed
Source: lib/public/Share/IManager.php#424 Returns: bool Since: 14.0.0
-
public
OCP\Share\IManager::
shareProviderExists
($shareType)¶ - Check if a given share provider exists
Source: Parameters: - $shareType (int)
Returns: bool
Since: 11.0.0
-
public
OCP\Share\IManager::
registerShareProvider
($shareProviderClass)¶ Source: Parameters: - $shareProviderClass (string)
Since: 21.0.0
-
public
OCP\Share\IManager::
getAllShares
()¶ Source: lib/public/Share/IManager.php#451 Returns: iterable
Since: 18.0.0