Skip to content

Commit

Permalink
fix: Set proper user scope for direct editing
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Jan 9, 2024
1 parent 79e5c77 commit 86dd761
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Controller/DirectViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use OCA\Richdocuments\Db\DirectMapper;
use OCA\Richdocuments\Service\FederationService;
use OCA\Richdocuments\Service\InitialStateService;
use OCA\Richdocuments\Service\UserScopeService;
use OCA\Richdocuments\TemplateManager;
use OCA\Richdocuments\TokenManager;
use OCP\AppFramework\Controller;
Expand All @@ -52,6 +53,9 @@ class DirectViewController extends Controller {
/** @var TokenManager */
private $tokenManager;

/** @var UserScopeService */
private $userScopeService;

/** @var DirectMapper */
private $directMapper;

Expand Down Expand Up @@ -79,6 +83,7 @@ public function __construct(
IRootFolder $rootFolder,
TokenManager $tokenManager,
DirectMapper $directMapper,
UserScopeService $userScopeService,
InitialStateService $initialState,
IConfig $config,
AppConfig $appConfig,
Expand All @@ -90,6 +95,7 @@ public function __construct(

$this->rootFolder = $rootFolder;
$this->tokenManager = $tokenManager;
$this->userScopeService = $userScopeService;
$this->directMapper = $directMapper;
$this->initialState = $initialState;
$this->config = $config;
Expand Down Expand Up @@ -125,6 +131,8 @@ public function show($token) {
return $this->showPublicShare($direct);
}

$this->userScopeService->setUserScope($direct->getUid());
$this->userScopeService->setFilesystemScope($direct->getUid());

$folder = $this->rootFolder->getUserFolder($direct->getUid());
if ($this->templateManager->isTemplate($direct->getFileid())) {
Expand Down

0 comments on commit 86dd761

Please sign in to comment.