Allow getting *all* share entries owned by a user
This commit is contained in:
parent
849e5521de
commit
518d5aadf5
|
@ -103,7 +103,9 @@ class Test_Files_Sharing_Permissions extends OCA\Files_sharing\Tests\TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function tearDown() {
|
protected function tearDown() {
|
||||||
$this->sharedCache->clear();
|
if ($this->sharedCache) {
|
||||||
|
$this->sharedCache->clear();
|
||||||
|
}
|
||||||
|
|
||||||
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
|
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
|
||||||
|
|
||||||
|
|
|
@ -2518,4 +2518,16 @@ class Share extends \OC\Share\Constants {
|
||||||
$enforcePassword = $config->getAppValue('core', 'shareapi_enforce_links_password', 'no');
|
$enforcePassword = $config->getAppValue('core', 'shareapi_enforce_links_password', 'no');
|
||||||
return ($enforcePassword === "yes") ? true : false;
|
return ($enforcePassword === "yes") ? true : false;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Get all share entries, including non-unique group items
|
||||||
|
*
|
||||||
|
* @param string $owner
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function getAllSharesForOwner($owner) {
|
||||||
|
$query = 'SELECT * FROM `*PREFIX*share` WHERE `uid_owner` = ?';
|
||||||
|
$result = \OC::$server->getDatabaseConnection()->executeQuery($query, [$owner]);
|
||||||
|
return $result->fetchAll();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue