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
@@ -91,6 +91,10 @@ type Dialect interface {
// column names to values to use in the where clause.
// The update is executed as part of the provided session.
Update(ctx context.Context, tx *session.SessionTx, tableName string, row map[string]any, where map[string]any) error
// Concat returns the sql statement for concating multiple strings
// Implementations are not expected to quote the arguments
// therefore any callers should take care to quote arguments as necessary
Concat(...string) string
}
type LockCfg struct {
@@ -450,3 +454,7 @@ func (b *BaseDialect) Update(ctx context.Context, tx *session.SessionTx, tableNa
_, err = tx.Exec(ctx, query, args...)
return err
}
func (b *BaseDialect) Concat(strs ...string) string {
return fmt.Sprintf("CONCAT(%s)", strings.Join(strs, ", "))
}