/** * Checks to see if a request is internal and therefore can bypass some or all security * @param reference an entity reference string * @return true if internal OR false if external or REST */ public boolean isEntityRequestInternal(String reference) { boolean internal = false; String origin = (String) requestStorage.getStoredValue(RequestStorage.ReservedKeys._requestOrigin.name()); if (RequestStorage.RequestOrigin.INTERNAL.name().equals(origin)) { internal = true; } else { if (reference != null) { String ref = (String) requestStorage.getStoredValue(RequestStorage.ReservedKeys._requestEntityReference.name()); if (reference.equals(ref)) { // if this ref was the one requested from outside it is definitely not internal internal = false; } else { internal = true; } } } return internal; }