{
if (src == null) {
return null;
}
final Integer userId = PFUserContext.getUserId();
final CalendarObject cal = new CalendarObject();
DOConverter.copyFields(cal, src);
cal.setTitle(src.getTitle());
cal.setDescription(src.getDescription());
cal.setExternalSubscription(src.isExternalSubscription());
final TeamCalRight right = (TeamCalRight) UserRights.instance().getRight(TeamCalDao.USER_RIGHT_ID);
cal.setMinimalAccess(right.hasMinimalAccess(src, userId));
cal.setReadonlyAccess(right.hasReadonlyAccess(src, userId));
cal.setFullAccess(right.hasFullAccess(src, userId));
cal.setOwner(ObjectUtils.equals(userId, src.getOwnerId()));
return cal;
}