Skip to content

Commit

Permalink
fix call to deprecated circles api
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed Nov 23, 2022
1 parent 3aa16d6 commit 1d09083
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@

use OC\Files\FileInfo;
use OC\Files\Storage\Wrapper\Wrapper;
use OCA\Files\Helper;
use OCA\Files_Sharing\Exceptions\SharingRightsException;
use OCA\Files_Sharing\External\Storage;
use OCA\Files_Sharing\SharedStorage;
use OCA\Files\Helper;
use OCP\App\IAppManager;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSBadRequestException;
Expand All @@ -59,9 +59,9 @@
use OCP\AppFramework\OCSController;
use OCP\AppFramework\QueryException;
use OCP\Constants;
use OCP\Files\Folder;
use OCP\Files\InvalidPathException;
use OCP\Files\IRootFolder;
use OCP\Files\Folder;
use OCP\Files\Node;
use OCP\Files\NotFoundException;
use OCP\IConfig;
Expand All @@ -74,7 +74,6 @@
use OCP\IUserManager;
use OCP\Lock\ILockingProvider;
use OCP\Lock\LockedException;
use OCP\Share;
use OCP\Share\Exceptions\GenericShareException;
use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IManager;
Expand Down Expand Up @@ -1797,12 +1796,16 @@ private function shareProviderResharingRights(string $userId, IShare $share, $no
$sharedWith = substr($share->getSharedWith(), $shareWithStart, $shareWithLength);
}
try {
$member = \OCA\Circles\Api\v1\Circles::getMember($sharedWith, $userId, 1);
if ($member->getLevel() >= 4) {
return true;
}
// checking if user is within said circle
// deprecated API, needs to be edited when ICirclesManager is implemented
\OCA\Circles\Api\v1\Circles::getMember($sharedWith, $userId, 1);

return true;
} catch (\OCA\Circles\Exceptions\MembershipNotFoundException $e) {
return false;
} catch (QueryException $e) {
} catch (\Exception $e) {
\OC::$server->getLogger()->logException($e);

return false;
}
}
Expand Down

0 comments on commit 1d09083

Please sign in to comment.