@Override @HasPermission(action = UGC_READ, type = SocialPermission.class) public long count(final String threadId, final String contextId) throws UGCException { try { return ugcRepository.countByTargetId(contextId, threadId, 0); } catch (MongoDataException e) { log.error("logging.ugc.unableToCount"); throw new UGCException("Unable to count UGC by target and context", e); } }