Storage: `system/branding` storage (#51987)

* Storage: add `system` branding storage root, expose `system/branding` subfolder

* Storage: merge
pull/52419/head
Artur Wierzbicki 3 years ago committed by GitHub
parent e7feff6d99
commit 841e5ae8ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      pkg/services/store/service.go

@ -28,6 +28,9 @@ var ErrAccessDenied = errors.New("access denied")
const RootPublicStatic = "public-static"
const RootResources = "resources"
const RootDevenv = "devenv"
const RootSystem = "system"
const SystemBrandingStorage = "system/branding"
const MAX_UPLOAD_SIZE = 1 * 1024 * 1024 // 3MB
@ -114,6 +117,13 @@ func ProvideService(sql *sqlstore.SQLStore, features featuremgmt.FeatureToggles,
setDescription("Upload custom resource files"))
}
storages = append(storages,
newSQLStorage(RootSystem,
"System",
&StorageSQLConfig{orgId: orgId},
sql,
).setBuiltin(true).setDescription("Grafana system storage"))
return storages
}
@ -141,6 +151,12 @@ func ProvideService(sql *sqlstore.SQLStore, features featuremgmt.FeatureToggles,
ActionFilesWrite: allowAllPathFilter,
ActionFilesDelete: allowAllPathFilter,
}
case RootSystem:
return map[string]filestorage.PathFilter{
ActionFilesRead: allowAllPathFilter,
ActionFilesWrite: allowAllPathFilter,
ActionFilesDelete: allowAllPathFilter,
}
default:
return nil
}

Loading…
Cancel
Save