When a user has an active session only the apps that are enabled for the
user are initially loaded. In order to cache the routes the routes for
all apps are loaded, but routes defined in routes.php are taken into
account only if the app was already loaded. Therefore, when the routes
were cached in a request by a user with an active session only the
routes for apps enabled for that user were cached, and those routes were
used by any other user, independently of which apps they had access to.
To solve that now all the enabled apps are explicitly loaded before
caching the routes.
Note that this did not affect routes defined using annotations on the
controller files; in that case the loaded routes do not depend on the
previously loaded apps, as it explicitly checks all the enabled apps.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This reverts commit 90948f5096.
It temporary disabled cache for routes until an actual fix was added,
which is done in the following commits.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This allows testing a newly added or changed route in your application
without having to wait 1 hour or bump the application version.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This is not ideal because serializing the routecollection is not easy.
It seems Symfony has its own way of doing things by dumping routes to a
PHP file, maybe that would be better, but it would mean pulling a new
symfony dependency and maybe refactor our Router.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>