Nested Folders: Fix /api/folders pagination (#79447)

* Nested Folders: Fix /api/folders pagination

We used to check access to the root folders after fetching them from the DB with pagination.
This fix splits logic for fetching folders in:
- fetching subfolders
- fetching root folders
and refactors the query for the latter so that is filters by folders with permissions

* Add tests

* Update benchmarks
This commit is contained in:
Sofia Papagiannaki
2023-12-15 19:34:08 +02:00
committed by GitHub
parent cf8e8852c3
commit d89a8a3a82
9 changed files with 434 additions and 55 deletions
+5 -2
View File
@@ -160,8 +160,8 @@ type GetParentsQuery struct {
// return a list of child folders of the given folder.
type GetChildrenQuery struct {
UID string `xorm:"uid"`
OrgID int64 `xorm:"org_id"`
UID string
OrgID int64
Depth int64
// Pagination options
@@ -169,6 +169,9 @@ type GetChildrenQuery struct {
Page int64
SignedInUser identity.Requester `json:"-"`
// array of folder uids to filter by
FolderUIDs []string `json:"-"`
}
type HasEditPermissionInFoldersQuery struct {