Roberto Sánchez
2014-01-10 3d0c6e4865d4a0ddd764da533a327faf76e0cb32
securis/src/main/java/net/curisit/securis/services/ApplicationResource.java
....@@ -144,6 +144,10 @@
144144 return Response.status(Status.NOT_FOUND).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "Application not found with ID: " + appid).build();
145145 }
146146
147
+ if (app.getLicenseTypes() != null && app.getLicenseTypes().size() > 0) {
148
+ return Response.status(Status.FORBIDDEN).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "Application can not be deleted becasue has assigned one or more License types, ID: " + appid).build();
149
+ }
150
+
147151 em.remove(app);
148152 return Response.ok(Utils.createMap("success", true, "id", appid)).build();
149153 }