Commit 0ad14370 by Tuomas Riihimäki

Permission and nullpointer fixes

1 parent 2b2d50ee
...@@ -138,7 +138,7 @@ public class EventBean implements EventBeanLocal { ...@@ -138,7 +138,7 @@ public class EventBean implements EventBeanLocal {
@Override @Override
@RolesAllowed({ SpecialPermission.S_SUPERADMIN, EventPermission.S_MANAGE_EVENT }) @RolesAllowed({ SpecialPermission.S_SUPERADMIN, EventPermission.S_MANAGE_EVENT })
public LanEvent mergeChanges(LanEvent event) { public LanEvent mergeChanges(LanEvent event) {
if (!permbean.hasPermission(SpecialPermission.SUPERADMIN) && getCurrentEvent().equals(event)) { if (!permbean.hasPermission(SpecialPermission.SUPERADMIN) && !getCurrentEvent().equals(event)) {
throw new EJBAccessException("Trying to save another event."); throw new EJBAccessException("Trying to save another event.");
} }
return eventFacade.merge(event); return eventFacade.merge(event);
...@@ -187,8 +187,7 @@ public class EventBean implements EventBeanLocal { ...@@ -187,8 +187,7 @@ public class EventBean implements EventBeanLocal {
public LanEventProperty getProperty(LanEventPropertyKey property) { public LanEventProperty getProperty(LanEventPropertyKey property) {
return eventPropertyFacade.find(getCurrentEvent(), property); return eventPropertyFacade.find(getCurrentEvent(), property);
} }
@Override @Override
public long getPropertyLong(LanEventPropertyKey property) public long getPropertyLong(LanEventPropertyKey property)
{ {
...@@ -201,8 +200,6 @@ public class EventBean implements EventBeanLocal { ...@@ -201,8 +200,6 @@ public class EventBean implements EventBeanLocal {
} }
return ret; return ret;
} }
@Override @Override
public String getPropertyString(LanEventPropertyKey property) public String getPropertyString(LanEventPropertyKey property)
......
...@@ -265,7 +265,7 @@ public class PlaceMap extends HttpServlet { ...@@ -265,7 +265,7 @@ public class PlaceMap extends HttpServlet {
color = RESERVED_COLOR; color = RESERVED_COLOR;
// logger.debug("Setting place Reserved {}", p); // logger.debug("Setting place Reserved {}", p);
} else if (p.getProduct().getColor() != null && !p.getProduct().getColor().isEmpty()) { } else if (p.getProduct() != null && p.getProduct() != null && p.getProduct().getColor() != null && !p.getProduct().getColor().isEmpty()) {
try { try {
color = Color.decode(p.getProduct().getColor()); color = Color.decode(p.getProduct().getColor());
...@@ -273,8 +273,8 @@ public class PlaceMap extends HttpServlet { ...@@ -273,8 +273,8 @@ public class PlaceMap extends HttpServlet {
logger.error("Cannot convert string {} to color.", p.getProduct().getColor()); logger.error("Cannot convert string {} to color.", p.getProduct().getColor());
} }
} else { } else {
// too much debugging -TKjne // too much debugging -TKjne
// logger.debug("Nothing special for this place. Color should be default."); // logger.debug("Nothing special for this place. Color should be default.");
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!