private Object checkObjectAuth(Object value) {
    Object obj = value;
    if (value instanceof CqEntry) {
      obj = ((CqEntry) value).getValue();
    }

    if (obj instanceof ObjectWithAuthz) {
      int lastChar = principalName.charAt(principalName.length() - 1) - '0';
      lastChar %= 10;
      ObjectWithAuthz authzObj = (ObjectWithAuthz) obj;
      int authzIndex = (Integer) authzObj.getAuthz() - '0';
      authzIndex %= 10;
      if ((lastChar == 0) || (authzIndex % lastChar != 0)) {
        logger.warning(
            String.format(
                "FilterPostAuthorization: The user [%s] is not authorized for the object %s.",
                principalName, authzObj.getVal()));
        return null;
      } else {
        if (logger.fineEnabled()) {
          logger.fine("FilterPostAuthorization: user [" + principalName
              + "] authorized for object: " + authzObj.getVal());
        }
        if (value instanceof CqEntry) {
          return new CqEntry(((CqEntry) value).getKey(), authzObj.getVal());
        } else {
          return authzObj.getVal();
        }
      }
    }
    logger.warning(
        String.format("FilterPostAuthorization: The object of type %s, is not an instance of %s.",
            obj.getClass(), ObjectWithAuthz.class));
    return null;
  }
An authorization implementation for testing that checks for authorization information in
post-operation filtering, removes that field and allows the operation only if the authorization
field in {@link ObjectWithAuthz} object allows the current principal.

@since GemFire 5.5
geode-cq/src/distributedTest/java/org/apache/geode/security/FilterPostAuthorization.java