Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable26] fix: Set proper user scope for direct editing #3397

Merged
merged 1 commit into from
Jan 9, 2024
Merged
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
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
Loading