diff --git a/lib/Hooks.php b/lib/Hooks.php index 0005be3b..32c390bf 100644 --- a/lib/Hooks.php +++ b/lib/Hooks.php @@ -10,12 +10,8 @@ namespace OCA\Guests; -use OC\Files\Filesystem; use OCA\Guests\AppInfo\Application; use OCA\Guests\Service\InviteService; -use OCA\Guests\Storage\ReadOnlyJail; -use OCP\Constants; -use OCP\Files\Storage\IStorage; use OCP\IConfig; use OCP\IUserManager; use OCP\IUserSession; @@ -76,28 +72,6 @@ public function handlePostShare(ShareCreatedEvent $event): void { $this->inviteService->sendInvite($uid, $shareWith, $share); } - /** - * @param array $params - */ - public function setupReadonlyFilesystem(array $params): void { - $uid = $params['user']; - $user = $this->userManager->get($uid); - - if ($user && $this->guestManager->isGuest($user)) { - Filesystem::addStorageWrapper('guests.readonly', function ($mountPoint, IStorage $storage) use ($uid): ReadOnlyJail|IStorage { - if ($mountPoint === sprintf('/%s/', $uid)) { - return new ReadOnlyJail([ - 'storage' => $storage, - 'mask' => Constants::PERMISSION_READ, - 'path' => 'files' - ]); - } - - return $storage; - }); - } - } - public function handleFirstLogin(UserFirstTimeLoggedInEvent $event): void { if (!$this->config->getSystemValueBool('migrate_guest_user_data', false)) { return; diff --git a/lib/RestrictionManager.php b/lib/RestrictionManager.php index e4a68f6d..a82c1688 100644 --- a/lib/RestrictionManager.php +++ b/lib/RestrictionManager.php @@ -21,7 +21,6 @@ use OCP\IUserSession; use OCP\Server; use OCP\Settings\IManager; -use OCP\Util; use Psr\Log\LoggerInterface; class RestrictionManager { @@ -54,7 +53,6 @@ public function setupRestrictions(): void { } if ($this->guestManager->isGuest($user)) { - Util::connectHook('OC_Filesystem', 'preSetup', $this->hooks, 'setupReadonlyFilesystem'); if (!$this->config->allowExternalStorage()) { $this->mountProviderCollection->registerMountFilter(fn (IMountPoint $mountPoint, IUser $user): bool => !($mountPoint instanceof ExternalMountPoint && $this->guestManager->isGuest($user))); } diff --git a/lib/Storage/ReadOnlyJail.php b/lib/Storage/ReadOnlyJail.php deleted file mode 100644 index 82bd8114..00000000 --- a/lib/Storage/ReadOnlyJail.php +++ /dev/null @@ -1,27 +0,0 @@ -getWrapperStorage()->isDeletable($path); - } -}