/** * Does this object satisfy the criteria of the filter? * * @param o * The object to test. * @return true if the object is accepted by the filter, false if not. */ public boolean accept(Object o) { // we want to test only messages if (!(o instanceof Message)) { return false; } // if the item cannot be read, reject it if (!unlockCheck(SECURE_READ, ((Message) o).getReference())) { return false; } // accept this one return true; } // accept
/** * Does this object satisfy the criteria of the filter? * * @param o * The object to test. * @return true if the object is accepted by the filter, false if not. */ public boolean accept(Object o) { // we want to test only messages if (!(o instanceof Message)) { return false; } // if the item cannot be read, reject it if (!unlockCheck(SECURE_READ, ((Message) o).getReference())) { return false; } // accept this one return true; } // accept
/** * Does this object satisfy the criteria of the filter? * * @param o * The object to test. * @return true if the object is accepted by the filter, false if not. */ public boolean accept(Object o) { // we want to test only messages if (!(o instanceof Message)) { return false; } // if the item cannot be read, reject it if (!unlockCheck(SECURE_READ, ((Message) o).getReference())) { return false; } // accept this one return true; } // accept
nextMessage = nextMessage + 1; listPos = listPos + 1; return m.getReference(); nextMessage = nextMessage + 1; listPos = listPos + 1; return m.getReference();
public List getSiteContent(String context) { List<String> all = new ArrayList<String>(); List l = messageService.getChannelIds(context); for (Iterator i = l.iterator(); i.hasNext();) { String chanellId = (String) i.next(); try { MessageChannel c = messageService.getChannel(messageService .channelReference(context, chanellId)); List messages = c.getMessages(null, true); // WARNING: I think the implementation caches on thread, if this // is // a builder // thread this may not work for (Iterator mi = messages.iterator(); mi.hasNext();) { Message m = (Message) mi.next(); all.add(m.getReference()); } } catch (Exception ex) { ex.printStackTrace(); log.warn("Failed to get channel " + chanellId); //$NON-NLS-1$ } } return all; }
/** * check permissions for the message, to be able to edit or save it. * * @param m * The message. * @return true if the user is allowed to update the message, false if not. */ protected boolean allowEditMessage(Message m, String fOwn, String fAny) { // is this the user's own? if (m.getHeader().getFrom().getId().equals(m_sessionManager.getCurrentSessionUserId())) { // own or any return unlockCheck2(fOwn, fAny, m.getReference()); } else { // just any return unlockCheck(fAny, m.getReference()); } }
/** * check permissions for the message, to be able to edit or save it. * * @param m * The message. * @return true if the user is allowed to update the message, false if not. */ protected boolean allowEditMessage(Message m, String fOwn, String fAny) { // is this the user's own? if (m.getHeader().getFrom().getId().equals(m_sessionManager.getCurrentSessionUserId())) { // own or any return unlockCheck2(fOwn, fAny, m.getReference()); } else { // just any return unlockCheck(fAny, m.getReference()); } }
/** * check permissions for the message, to be able to edit or save it. * * @param m * The message. * @return true if the user is allowed to update the message, false if not. */ protected boolean allowEditMessage(Message m, String fOwn, String fAny) { // is this the user's own? if (m.getHeader().getFrom().getId().equals(m_sessionManager.getCurrentSessionUserId())) { // own or any return unlockCheck2(fOwn, fAny, m.getReference()); } else { // just any return unlockCheck(fAny, m.getReference()); } }
m_threadLocalManager.set(m.getReference(), m);
m_threadLocalManager.set(m.getReference(), m);
if (contextualUserDisplayService != null) Reference ref1 = entityManager.newReference(m.getReference()); String context = siteService.siteReference(ref1.getContext()); displayName = contextualUserDisplayService.getUserDisplayName(mh.getFrom(), context);
if (contextualUserDisplayService != null) Reference ref1 = entityManager.newReference(m.getReference()); String context = siteService.siteReference(ref1.getContext()); displayName = contextualUserDisplayService.getUserDisplayName(mh.getFrom(), context);
m_threadLocalManager.set(m.getReference(), m);
msgCache.put(msg.getReference(), msg);
throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), eventId(function), m.getReference());
throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), eventId(function), m.getReference());
throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), eventId(function), m.getReference());