mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #37836 from nextcloud/backport/37826/stable26
[stable26] fix(files): Don't throw an error when guests access the controller
This commit is contained in:
commit
6c67fd5b06
2 changed files with 8 additions and 15 deletions
|
|
@ -67,27 +67,17 @@ class ApiController extends Controller {
|
|||
private IPreview $previewManager;
|
||||
private IUserSession $userSession;
|
||||
private IConfig $config;
|
||||
private Folder $userFolder;
|
||||
private ?Folder $userFolder;
|
||||
private UserConfig $userConfig;
|
||||
|
||||
/**
|
||||
* @param string $appName
|
||||
* @param IRequest $request
|
||||
* @param IUserSession $userSession
|
||||
* @param TagService $tagService
|
||||
* @param IPreview $previewManager
|
||||
* @param IManager $shareManager
|
||||
* @param IConfig $config
|
||||
* @param Folder $userFolder
|
||||
*/
|
||||
public function __construct($appName,
|
||||
public function __construct(string $appName,
|
||||
IRequest $request,
|
||||
IUserSession $userSession,
|
||||
TagService $tagService,
|
||||
IPreview $previewManager,
|
||||
IManager $shareManager,
|
||||
IConfig $config,
|
||||
Folder $userFolder,
|
||||
?Folder $userFolder,
|
||||
UserConfig $userConfig) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->userSession = $userSession;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class TagService {
|
|||
private $activityManager;
|
||||
/** @var ITags|null */
|
||||
private $tagger;
|
||||
/** @var Folder */
|
||||
/** @var Folder|null */
|
||||
private $homeFolder;
|
||||
/** @var EventDispatcherInterface */
|
||||
private $dispatcher;
|
||||
|
|
@ -53,7 +53,7 @@ class TagService {
|
|||
IUserSession $userSession,
|
||||
IManager $activityManager,
|
||||
?ITags $tagger,
|
||||
Folder $homeFolder,
|
||||
?Folder $homeFolder,
|
||||
EventDispatcherInterface $dispatcher
|
||||
) {
|
||||
$this->userSession = $userSession;
|
||||
|
|
@ -77,6 +77,9 @@ class TagService {
|
|||
if ($this->tagger === null) {
|
||||
throw new \RuntimeException('No tagger set');
|
||||
}
|
||||
if ($this->homeFolder === null) {
|
||||
throw new \RuntimeException('No homeFolder set');
|
||||
}
|
||||
|
||||
$fileId = $this->homeFolder->get($path)->getId();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue