mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 18:51:10 +01:00
Detect core plugins and prevent installation
This commit is contained in:
@@ -25,6 +25,8 @@ public class PluginDto extends HalRepresentation {
|
||||
private String category;
|
||||
private String avatarUrl;
|
||||
private boolean pending;
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private Boolean core;
|
||||
private Set<String> dependencies;
|
||||
|
||||
public PluginDto(Links links) {
|
||||
|
||||
@@ -67,7 +67,8 @@ public abstract class PluginDtoMapper {
|
||||
Links.Builder links = linkingTo()
|
||||
.self(resourceLinks.installedPlugin()
|
||||
.self(information.getName()));
|
||||
if (availablePlugin.isPresent()
|
||||
if (!plugin.isCore()
|
||||
&& availablePlugin.isPresent()
|
||||
&& !availablePlugin.get().isPending()
|
||||
&& PluginPermissions.manage().isPermitted()
|
||||
) {
|
||||
@@ -81,6 +82,8 @@ public abstract class PluginDtoMapper {
|
||||
dto.setPending(value.isPending());
|
||||
});
|
||||
|
||||
dto.setCore(plugin.isCore());
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user