fix(dbfs): enforce root protection for single file share
This commit is contained in:
@@ -25,6 +25,7 @@ type dbfsOption struct {
|
||||
noChainedCreation bool
|
||||
streamListResponseCallback func(parent fs.File, file []fs.File)
|
||||
ancestor *File
|
||||
notRoot bool
|
||||
}
|
||||
|
||||
func newDbfsOption() *dbfsOption {
|
||||
@@ -56,6 +57,13 @@ func WithFilePublicMetadata() fs.Option {
|
||||
})
|
||||
}
|
||||
|
||||
// WithNotRoot force the get result cannot be a root folder
|
||||
func WithNotRoot() fs.Option {
|
||||
return optionFunc(func(o *dbfsOption) {
|
||||
o.notRoot = true
|
||||
})
|
||||
}
|
||||
|
||||
// WithContextHint enables generating context hint for the list operation.
|
||||
func WithContextHint() fs.Option {
|
||||
return optionFunc(func(o *dbfsOption) {
|
||||
|
||||
Reference in New Issue
Block a user