aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2021-03-02 19:34:20 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2021-03-03 14:52:47 +0100
commit68ec18323d07e7293fd59c82d51300a6d9d68176 (patch)
treef8b2094b663d481dda920d1df8f9c852fa42ee36 /lib/private/AppFramework
parent252d2d39583c7daf838a6a24d0f72660ed01c371 (diff)
downloadnextcloud-server-68ec18323d07e7293fd59c82d51300a6d9d68176.tar.gz
nextcloud-server-68ec18323d07e7293fd59c82d51300a6d9d68176.zip
Fix types in the Group Manager
Psalm found an issue. However the issue found was because of lying docblocks. Fixed those and did some typing to make it all better. For #25839 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index 3ef816f503e..7395be703d3 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -234,6 +234,8 @@ class DIContainer extends SimpleContainer implements IAppContainer {
)
);
+
+
$securityMiddleware = new SecurityMiddleware(
$c->get(IRequest::class),
$c->get(IControllerMethodReflector::class),
@@ -242,7 +244,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
$server->query(ILogger::class),
$c->get('AppName'),
$server->getUserSession()->isLoggedIn(),
- $server->getGroupManager()->isAdmin($this->getUserId()),
+ $this->getUserId() !== null && $server->getGroupManager()->isAdmin($this->getUserId()),
$server->getUserSession()->getUser() !== null && $server->query(ISubAdmin::class)->isSubAdmin($server->getUserSession()->getUser()),
$server->getAppManager(),
$server->getL10N('lib')