[MM-49929] Work templates: allow simple users to list marketplace plugins (#22151)

Этот коммит содержится в:
Julien Tant
2023-01-26 09:08:05 -07:00
коммит произвёл GitHub
родитель 1880297a90
Коммит 7bfca605e1
4 изменённых файлов: 86 добавлений и 18 удалений

Просмотреть файл

@@ -571,24 +571,26 @@ func (a *App) GetMarketplacePlugins(filter *model.MarketplacePluginFilter) ([]*m
plugins = p
}
// Some plugin don't work on cloud. The remote Marketplace is aware of this fact,
// but prepackaged plugins are not. Hence, on a cloud installation prepackaged plugins
// shouldn't be shown in the Marketplace modal.
// This is a short term fix. The long term solution is to have a separate set of
// prepacked plugins for cloud: https://mattermost.atlassian.net/browse/MM-31331.
license := a.Srv().License()
if license == nil || !license.IsCloud() {
appErr := a.mergePrepackagedPlugins(plugins)
if !filter.RemoteOnly {
// Some plugin don't work on cloud. The remote Marketplace is aware of this fact,
// but prepackaged plugins are not. Hence, on a cloud installation prepackaged plugins
// shouldn't be shown in the Marketplace modal.
// This is a short term fix. The long term solution is to have a separate set of
// prepacked plugins for cloud: https://mattermost.atlassian.net/browse/MM-31331.
license := a.Srv().License()
if license == nil || !license.IsCloud() {
appErr := a.mergePrepackagedPlugins(plugins)
if appErr != nil {
return nil, appErr
}
}
appErr := a.mergeLocalPlugins(plugins)
if appErr != nil {
return nil, appErr
}
}
appErr := a.mergeLocalPlugins(plugins)
if appErr != nil {
return nil, appErr
}
// Filter plugins.
var result []*model.MarketplacePlugin
for _, p := range plugins {