Unified Storage /Folders: Allow Unified Storage subfolders creation (#94327)
* Add parents field to folder DTO * Allow subfolder creation when folder flag is enabled * Update UnstructuredToLegacyFolder * Include parents field when creating folder
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package sql
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/authlib/claims"
|
||||
infraDB "github.com/grafana/grafana/pkg/infra/db"
|
||||
"github.com/grafana/grafana/pkg/infra/tracing"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
@@ -31,5 +34,16 @@ func NewResourceServer(db infraDB.DB, cfg *setting.Cfg, features featuremgmt.Fea
|
||||
opts.Index = resource.NewResourceIndexServer()
|
||||
}
|
||||
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagKubernetesFolders) {
|
||||
opts.WriteAccess = resource.WriteAccessHooks{
|
||||
Folder: func(ctx context.Context, user claims.AuthInfo, uid string) bool {
|
||||
// #TODO build on the logic here
|
||||
// #TODO only enable write access when the resource being written in the folder
|
||||
// is another folder
|
||||
return true
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
return resource.NewResourceServer(opts)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user