@Test public void testValidateGoodUserWithFilterUser() { UserManagerResolver umr = new UserManagerResolver(); Map<String, String> parameters = new HashMap<>(); parameters.put(UserManagerResolver.INPUT_PARAM_FILTER, UserManagerResolver.FILTER_USER); umr.configure(parameters); assertTrue(umr.validate("user:Administrator")); }
@Override public void configure(Map<String, String> parameters) throws IllegalStateException { super.configure(parameters); if (FILTER_USER.equals(parameters.get(INPUT_PARAM_FILTER))) { includingGroups = false; } else if (FILTER_GROUP.equals(parameters.get(INPUT_PARAM_FILTER))) { includingUsers = false; } this.parameters.put(PARAM_INCLUDE_GROUPS, includingGroups); this.parameters.put(PARAM_INCLUDE_USERS, includingUsers); }
UserManagerResolver extends AbstractObjectResolver implements ObjectResolver { @Override public void configure(Map<String, String> parameters) throws IllegalStateException { super.configure(parameters); if (FILTER_USER.equals(parameters.get(INPUT_PARAM_FILTER))) { includingGroups = false; } else if (FILTER_GROUP.equals(parameters.get(INPUT_PARAM_FILTER))) { includingUsers = false; } this.parameters.put(PARAM_INCLUDE_GROUPS, includingGroups); this.parameters.put(PARAM_INCLUDE_USERS, includingUsers); } }
UserManagerResolver extends AbstractObjectResolver implements ObjectResolver { @Override public void configure(Map<String, String> parameters) throws IllegalStateException { super.configure(parameters); if (FILTER_USER.equals(parameters.get(INPUT_PARAM_FILTER))) { includingGroups = false; } else if (FILTER_GROUP.equals(parameters.get(INPUT_PARAM_FILTER))) { includingUsers = false; } this.parameters.put(PARAM_INCLUDE_GROUPS, includingGroups); this.parameters.put(PARAM_INCLUDE_USERS, includingUsers); }  }
UserManagerResolver extends AbstractObjectResolver implements ObjectResolver { @Override public void configure(Map<String, String> parameters) throws IllegalStateException { super.configure(parameters); if (FILTER_USER.equals(parameters.get(INPUT_PARAM_FILTER))) { includingGroups = false; } else if (FILTER_GROUP.equals(parameters.get(INPUT_PARAM_FILTER))) { includingUsers = false; } this.parameters.put(PARAM_INCLUDE_GROUPS, includingGroups); this.parameters.put(PARAM_INCLUDE_USERS, includingUsers); }  UserManager getUserManager(); @Override List<Class<?>> getManagedClasses(); @Override void configure(Map<String, String> parameters); @Override String getName(); @Override Object fetch(Object value); @SuppressWarnings("unchecked") @Override T fetch(Class<T> type, Object value); @Override Serializable getReference(Object entity); @Override String getConstraintErrorMessage(Object invalidValue, Locale locale); boolean isIncludingUsers(); boolean isIncludingGroups(); }
UserManagerResolver extends AbstractObjectResolver implements ObjectResolver { @Override public void configure(Map<String, String> parameters) throws IllegalStateException { super.configure(parameters); if (FILTER_USER.equals(parameters.get(INPUT_PARAM_FILTER))) { includingGroups = false; } else if (FILTER_GROUP.equals(parameters.get(INPUT_PARAM_FILTER))) { includingUsers = false; } this.parameters.put(PARAM_INCLUDE_GROUPS, includingGroups); this.parameters.put(PARAM_INCLUDE_USERS, includingUsers); }  UserManager getUserManager(); @Override List<Class<?>> getManagedClasses(); @Override void configure(Map<String, String> parameters); @Override String getName(); @Override Object fetch(Object value); @SuppressWarnings("unchecked") @Override T fetch(Class<T> type, Object value); @Override Serializable getReference(Object entity); @Override String getConstraintErrorMessage(Object invalidValue, Locale locale); boolean isIncludingUsers(); boolean isIncludingGroups(); static final String INPUT_PARAM_FILTER; static final String FILTER_GROUP; static final String FILTER_USER; static final String NAME; static final String PARAM_INCLUDE_USERS; static final String PARAM_INCLUDE_GROUPS; }