Exemple #1
0
 // TODO: change this metod for admin
 private void checkUpdateRights(Comment c, Long reqOwnerId) throws BetException {
   if (c == null) {
     throw new BetException("comment is not specified");
   }
   if (reqOwnerId == null) {
     throw new BetException("request owner is not specified");
   }
   if (!c.getUserId().equals(reqOwnerId)) {
     throw new BetException("Access denied");
   }
 }
Exemple #2
0
 @Override
 public List<SimpleComment> getSimpleBetComments(Long betId, Long ownerId) throws BetException {
   List<SimpleComment> sbList = new ArrayList();
   List<Comment> list = getBetComments(betId, ownerId);
   for (Comment c : list) {
     sbList.add(
         new SimpleComment(
             c.getMessage(),
             userMan.getVkIdByUserId(c.getUserId()),
             c.getBetId(),
             c.getCreationDate() == null ? null : c.getCreationDate().getTime(),
             c.getId()));
   }
   return sbList;
 }