Skip to content

Commit

Permalink
Merge pull request #3397 from nextcloud/backport/3293/stable26
Browse files Browse the repository at this point in the history
[stable26] fix: Set proper user scope for direct editing
  • Loading branch information
juliushaertl committed Jan 9, 2024
2 parents 79e5c77 + 86dd761 commit 6bf0c45
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 6bf0c45

Please sign in to comment.