diff --git a/Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/entity/PagedResults.scala b/Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/entity/PagedResults.scala index 93e71e97a5..15b461ce9c 100644 --- a/Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/entity/PagedResults.scala +++ b/Source/Plugins/Core/com.equella.core/scalasrc/com/tle/web/api/entity/PagedResults.scala @@ -81,9 +81,14 @@ object PagedResults { } def getAvailable: Int = { - // It's acceptable to retrieve all because targeted BaseEntities are all small datasets. - val entities = getBaseEntities(0, -1) - filterByPermission(entities).length + // We only return the full number of available entities because filtering entities by ACL is very slow. + // Here is an example that would it. + // val entities = getBaseEntities(0, -1) + // filterByPermission(entities).length + + res.getEntityService + .countAll(new EnumerateOptions(q, 0, -1, system, if (includeDisabled) null else false)) + .toInt } def collectMore(length: Int, initialOffset: Int): (Int, List[PagedEntity[BE]]) = { diff --git a/build.sbt b/build.sbt index eba0f1d5c9..fd8d2c733c 100644 --- a/build.sbt +++ b/build.sbt @@ -116,7 +116,7 @@ name := "Equella" equellaMajor in ThisBuild := 2021 equellaMinor in ThisBuild := 1 -equellaPatch in ThisBuild := 4 +equellaPatch in ThisBuild := 5 equellaStream in ThisBuild := "Stable" equellaBuild in ThisBuild := buildConfig.value.getString("build.buildname")