Move SCUM lifecycle ownership to plugin
This commit is contained in:
@@ -748,6 +748,7 @@ func gamePluginFromManifestRegistration(registration domain.GamePluginManifestRe
|
||||
DeclaredPermissions: manifest.Permissions,
|
||||
Permissions: pluginPermissionsFromManifest(manifest.Permissions),
|
||||
LifecycleActions: manifest.Actions,
|
||||
LifecycleAssets: lifecycleAssetsFromManifestRegistration(registration),
|
||||
BridgeActions: manifest.Bridge.Actions,
|
||||
Pages: manifest.Pages,
|
||||
FileWorkspace: manifest.FileWorkspace,
|
||||
@@ -762,6 +763,25 @@ func gamePluginFromManifestRegistration(registration domain.GamePluginManifestRe
|
||||
}
|
||||
}
|
||||
|
||||
func lifecycleAssetsFromManifestRegistration(registration domain.GamePluginManifestRegistration) []domain.PluginAssetFile {
|
||||
assets := domain.CopyPluginAssetFiles(registration.AssetFiles)
|
||||
if len(registration.Manifest.AssetFiles) == 0 {
|
||||
return assets
|
||||
}
|
||||
modeByPath := map[string]int{}
|
||||
for _, file := range registration.Manifest.AssetFiles {
|
||||
if file.Mode != 0 {
|
||||
modeByPath[file.Path] = file.Mode
|
||||
}
|
||||
}
|
||||
for i := range assets {
|
||||
if assets[i].Mode == 0 {
|
||||
assets[i].Mode = modeByPath[assets[i].Path]
|
||||
}
|
||||
}
|
||||
return assets
|
||||
}
|
||||
|
||||
func (svc *CoreService) AuthorizePluginBridgeAction(request domain.PluginBridgeAuthorizeRequest) (domain.PluginBridgeAuthorization, error) {
|
||||
if err := validator.ValidatePluginBridgeAuthorizeRequest(request); err != nil {
|
||||
return domain.PluginBridgeAuthorization{}, err
|
||||
|
||||
Reference in New Issue
Block a user