Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);

Check notice

Code scanning / Psalm

UndefinedClass

Class, interface or enum named OCA\Circles\Api\v1\Circles does not exist
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a stub for that in build/stubs and psalm.xml ? :)


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\OC::$server->getLogger()->logException($e);
\OC::$server->get(LoggerInterface::class)->error($e->getMessage(), ['exception' => $e, 'app' => 'files_sharing']);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better even from \OCP\Server


return false;
}
}
Expand Down