// TODO factorise
boolean isAdmin = cmsView.doAs(() -> CurrentUser.isInRole(NodeConstants.ROLE_USER_ADMIN));
- if (isAdmin)
+ if (isAdmin && adminLayers != null)
for (String layerId : adminLayers) {
if (layers.containsKey(layerId)) {
RankedObject<SuiteLayer> layerObj = layers.get(layerId);
}
}
+ public void removeLayer(SuiteLayer layer, Map<String, Object> properties) {
+ if (properties.containsKey(Constants.SERVICE_PID)) {
+ String pid = (String) properties.get(Constants.SERVICE_PID);
+ if (layers.containsKey(pid)) {
+ if (layers.get(pid).equals(new RankedObject<SuiteLayer>(layer, properties))) {
+ layers.remove(pid);
+ }
+ }
+ }
+ }
}