Browse Source

add api to get shares from a specific user

tags/v7.0.0alpha2
Bjoern Schiessle 10 years ago
parent
commit
c4e0fb75a4
2 changed files with 32 additions and 0 deletions
  1. 16
    0
      lib/private/share/share.php
  2. 16
    0
      lib/public/share.php

+ 16
- 0
lib/private/share/share.php View File

@@ -252,6 +252,22 @@ class Share extends \OC\Share\Constants {
$parameters, $limit, $includeCollections);
}

/**
* Get the items of item type shared with a user
* @param string Item type
* @param sting user id for which user we want the shares
* @param int Format (optional) Format type must be defined by the backend
* @param mixed Parameters (optional)
* @param int Number of items to return (optional) Returns all by default
* @param bool include collections (optional)
* @return Return depends on format
*/
public static function getItemsSharedWithUser($itemType, $user, $format = self::FORMAT_NONE,
$parameters = null, $limit = -1, $includeCollections = false) {
return self::getItems($itemType, null, self::$shareTypeUserAndGroups, $user, null, $format,
$parameters, $limit, $includeCollections);
}

/**
* Get the item of item type shared with the current user
* @param string $itemType

+ 16
- 0
lib/public/share.php View File

@@ -90,6 +90,22 @@ class Share extends \OC\Share\Constants {
return \OC\Share\Share::getItemsSharedWith($itemType, $format, $parameters, $limit, $includeCollections);
}

/**
* Get the items of item type shared with a user
* @param string Item type
* @param sting user id for which user we want the shares
* @param int Format (optional) Format type must be defined by the backend
* @param mixed Parameters (optional)
* @param int Number of items to return (optional) Returns all by default
* @param bool include collections (optional)
* @return Return depends on format
*/
public static function getItemsSharedWithUser($itemType, $user, $format = self::FORMAT_NONE,
$parameters = null, $limit = -1, $includeCollections = false) {

return \OC\Share\Share::getItemsSharedWithUser($itemType, $user, $format, $parameters, $limit, $includeCollections);
}

/**
* Get the item of item type shared with the current user
* @param string $itemType

Loading…
Cancel
Save