else
{
if(log.isDebugEnabled())
log.debug("event update denied: " + event2);
insertList.add(event2);
throw new AccessDeniedException(calendar.getName(),user.getUserName(),"WRITE");
}
}
else
{
if(log.isInfoEnabled())
log.info("event " + event.getId() + " not found, id incorrect?");
}
}
else
{
// create new Event, no eventid found
if(EntityAccessUtility.isAccessGranted(user,calendar,Access.WRITE))
{
EventCalendarVO ecvo = new EventCalendarVO(event,calendar);
ecvo.setParticipiantType(ParticipiantType.HOST);
ecvo.setInvitationStatus(InvitationStatus.ACCEPTED);
ecvo.setOwnerUser(calendar.getOwnerUser());
ecvo.setOwnerGroup(calendar.getOwnerGroup());
ecvo.setAccessUser(calendar.getAccessUser());
ecvo.setAccessGroup(calendar.getAccessGroup());
ecvo.setAccessGlobal(calendar.getAccessGlobal());
event.getEventCalendars().add(ecvo);
if(log.isDebugEnabled())
log.debug("new event created: " + event);
eventdao.insert(event);
insertList.add(event);
}
else
{
if(log.isDebugEnabled())
log.debug("create event denied: " + event);
insertList.add(event);
throw new AccessDeniedException(calendar.getName(),user.getUserName(),"WRITE");
}
}
}
if(handling == EventHandling.DELETE) // deleting events not in insertList