mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Storage: system/branding storage (#51987)
* Storage: add `system` branding storage root, expose `system/branding` subfolder * Storage: merge
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user