-// protected LdifUserAdmin(Hashtable<String, ?> properties, boolean scoped) {
-// super( properties, scoped);
-// }
-
-// public LdifUserAdmin(URI uri, Dictionary<String, ?> properties) {
-// super(uri, properties, false);
-// }
-
-// @Override
-// protected AbstractUserDirectory scope(User user) {
-// Dictionary<String, Object> credentials = user.getCredentials();
-// String username = (String) credentials.get(SHARED_STATE_USERNAME);
-// if (username == null)
-// username = user.getName();
-// Object pwdCred = credentials.get(SHARED_STATE_PASSWORD);
-// byte[] pwd = (byte[]) pwdCred;
-// if (pwd != null) {
-// char[] password = DirectoryDigestUtils.bytesToChars(pwd);
-// User directoryUser = (User) getRole(username);
-// if (!directoryUser.hasCredential(null, password))
-// throw new IllegalStateException("Invalid credentials");
-// } else {
-// throw new IllegalStateException("Password is required");
-// }
-// Dictionary<String, Object> properties = cloneProperties();
-// properties.put(DirectoryConf.readOnly.name(), "true");
-// LdifUserAdmin scopedUserAdmin = new LdifUserAdmin(properties, true);
-//// scopedUserAdmin.groups = Collections.unmodifiableNavigableMap(groups);
-//// scopedUserAdmin.users = Collections.unmodifiableNavigableMap(users);
-// scopedUserAdmin.entries = Collections.unmodifiableNavigableMap(entries);
-// return scopedUserAdmin;
-// }
-
- private static Dictionary<String, Object> fromUri(String uri, String baseDn) {
- Hashtable<String, Object> res = new Hashtable<String, Object>();
- res.put(DirectoryConf.uri.name(), uri);
- res.put(DirectoryConf.baseDn.name(), baseDn);
- return res;
- }
-