fix: Load all partially enabled apps routes

This avoids cache issues if some apps are only enabled for some groups,
 by loading the routes from all apps enabled for anyone, not only the
 current user.
If the queried application is disabled for the current user based on
 groups, the middleware will cancel the query.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/52793/head
Côme Chilliet 2025-06-05 18:06:08 +07:00
parent 12e7f46b30
commit bb485fb733
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
1 changed files with 2 additions and 2 deletions

@ -82,7 +82,7 @@ class Router implements IRouter {
public function getRoutingFiles() { public function getRoutingFiles() {
if ($this->routingFiles === null) { if ($this->routingFiles === null) {
$this->routingFiles = []; $this->routingFiles = [];
foreach (\OC_APP::getEnabledApps() as $app) { foreach ($this->appManager->getEnabledApps() as $app) {
try { try {
$appPath = $this->appManager->getAppPath($app); $appPath = $this->appManager->getAppPath($app);
$file = $appPath . '/appinfo/routes.php'; $file = $appPath . '/appinfo/routes.php';
@ -117,7 +117,7 @@ class Router implements IRouter {
$routingFiles = $this->getRoutingFiles(); $routingFiles = $this->getRoutingFiles();
$this->eventLogger->start('route:load:attributes', 'Loading Routes from attributes'); $this->eventLogger->start('route:load:attributes', 'Loading Routes from attributes');
foreach (\OC_App::getEnabledApps() as $enabledApp) { foreach ($this->appManager->getEnabledApps() as $enabledApp) {
$this->loadAttributeRoutes($enabledApp); $this->loadAttributeRoutes($enabledApp);
} }
$this->eventLogger->end('route:load:attributes'); $this->eventLogger->end('route:load:attributes');