mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
K8s/Folders: Add write access hook before creating index server (#96030)
Change order of when to add write access hook
This commit is contained in:
parent
1e58747a39
commit
7fa4a979e3
@ -48,10 +48,6 @@ func NewResourceServer(ctx context.Context, db infraDB.DB, cfg *setting.Cfg, fea
|
||||
opts.Diagnostics = store
|
||||
opts.Lifecycle = store
|
||||
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorageSearch) {
|
||||
opts.Index = resource.NewResourceIndexServer(cfg, tracer)
|
||||
}
|
||||
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagKubernetesFolders) {
|
||||
opts.WriteAccess = resource.WriteAccessHooks{
|
||||
Folder: func(ctx context.Context, user claims.AuthInfo, uid string) bool {
|
||||
@ -63,6 +59,10 @@ func NewResourceServer(ctx context.Context, db infraDB.DB, cfg *setting.Cfg, fea
|
||||
}
|
||||
}
|
||||
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorageSearch) {
|
||||
opts.Index = resource.NewResourceIndexServer(cfg, tracer)
|
||||
}
|
||||
|
||||
rs, err := resource.NewResourceServer(opts)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user