Prohibit uninstallation of core plugins

This commit is contained in:
Rene Pfeuffer
2019-09-16 14:12:49 +02:00
parent 1bc8dea481
commit 38f05fe689
2 changed files with 14 additions and 0 deletions

View File

@@ -188,6 +188,7 @@ public class DefaultPluginManager implements PluginManager {
PluginPermissions.manage().check();
InstalledPlugin installed = getInstalled(name)
.orElseThrow(() -> NotFoundException.notFound(entity(InstalledPlugin.class, name)));
doThrow().violation("plugin is a core plugin and cannot be uninstalled").when(installed.isCore());
dependencyTracker.removeInstalled(installed.getDescriptor());