Folders: Introduce folder service function for fetching folders by org and UIDs that contain optionally the folder full path (#80716)

* Folders: Expose function for getting all org folders with specific UIDs

* Return all org folders if UIDs is empty

* Filter out not accessible folders by the user

* Modify query to optionally returning a string that contains the UIDs of all parent folders separated by slash.
This commit is contained in:
Sofia Papagiannaki
2024-01-25 09:27:13 +02:00
committed by GitHub
parent f154b2b855
commit 5e88d29814
11 changed files with 579 additions and 83 deletions
+17 -5
View File
@@ -41,11 +41,13 @@ type Folder struct {
// TODO: validate if this field is required/relevant to folders.
// currently there is no such column
Version int
URL string
UpdatedBy int64
CreatedBy int64
HasACL bool
Version int
URL string
UpdatedBy int64
CreatedBy int64
HasACL bool
Fullpath string `xorm:"fullpath"`
FullpathUIDs string `xorm:"fullpath_uids"`
}
var GeneralFolder = Folder{ID: 0, Title: "General"}
@@ -149,6 +151,16 @@ type GetFolderQuery struct {
SignedInUser identity.Requester `json:"-"`
}
type GetFoldersQuery struct {
OrgID int64
UIDs []string
WithFullpath bool
WithFullpathUIDs bool
BatchSize uint64
SignedInUser identity.Requester `json:"-"`
}
// GetParentsQuery captures the information required by the folder service to
// return a list of all parent folders of a given folder.
type GetParentsQuery struct {