[Nested Folder] Block move operation that could introduce more than 8 level of depth,… (#59832)

* block move operation that could introduce more than 8 level of depth, forbid circular reference

* move getHeight to store, mock store in service

* fix linter
This commit is contained in:
ying-jeanne
2022-12-08 08:49:17 -05:00
committed by GitHub
parent 9094153b30
commit 1131bac5da
7 changed files with 185 additions and 48 deletions
+4
View File
@@ -27,4 +27,8 @@ type store interface {
// GetChildren returns the set of immediate children folders (depth=1) of the
// given folder.
GetChildren(ctx context.Context, cmd folder.GetTreeQuery) ([]*folder.Folder, error)
// GetHeight returns the height of the folder tree. When parentUID is set, the function would
// verify in the meanwhile that parentUID is not present in the subtree of the folder with the given UID.
GetHeight(ctx context.Context, foldrUID string, orgID int64, parentUID *string) (int, error)
}