// wait with registering these until auth is handled and the filesystem is setup
$server->subscribeEvent('beforeMethod', function () use ($server, $objectTree, $authBackend) {
$share = $authBackend->getShare();
- $owner = $share['uid_owner'];
- $isWritable = $share['permissions'] & (\OCP\PERMISSION_UPDATE | \OCP\PERMISSION_CREATE);
- $fileId = $share['file_source'];
+ $rootShare = \OCP\Share::resolveReShare($share);
+ $owner = $rootShare['uid_owner'];
+ $isWritable = $rootShare['permissions'] & (\OCP\PERMISSION_UPDATE | \OCP\PERMISSION_CREATE);
+ $fileId = $rootShare['file_source'];
if (!$isWritable) {
\OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, $storage) {