Skip to content
Open
Show file tree
Hide file tree
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
26 changes: 0 additions & 26 deletions lib/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -76,28 +72,6 @@ public function handlePostShare(ShareCreatedEvent $event): void {
$this->inviteService->sendInvite($uid, $shareWith, $share);
}

/**
* @param array<string, mixed> $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;
Expand Down
2 changes: 0 additions & 2 deletions lib/RestrictionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use OCP\IUserSession;
use OCP\Server;
use OCP\Settings\IManager;
use OCP\Util;
use Psr\Log\LoggerInterface;

class RestrictionManager {
Expand Down Expand Up @@ -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)));
}
Expand Down
27 changes: 0 additions & 27 deletions lib/Storage/ReadOnlyJail.php

This file was deleted.

Loading