| .. | .. |
|---|
| 144 | 144 | return Response.status(Status.NOT_FOUND).header(SecurisErrorHandler.HEADER_ERROR_MESSAGE, "Application not found with ID: " + appid).build(); |
|---|
| 145 | 145 | } |
|---|
| 146 | 146 | |
|---|
| 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 | + |
|---|
| 147 | 151 | em.remove(app); |
|---|
| 148 | 152 | return Response.ok(Utils.createMap("success", true, "id", appid)).build(); |
|---|
| 149 | 153 | } |
|---|