]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.util/src/org/argeo/osgi/useradmin/LdifGroup.java
Introduce transaction working copy abstraction
[lgpl/argeo-commons.git] / org.argeo.util / src / org / argeo / osgi / useradmin / LdifGroup.java
index b7167ea134684bacf63b25618446e8b198db27a5..72b08a8c3d0fc59c78fd3a0f3dc35ec45a0ffbd1 100644 (file)
@@ -5,10 +5,14 @@ import java.util.List;
 
 import javax.naming.InvalidNameException;
 import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.ldap.LdapName;
 
+import org.argeo.util.directory.FunctionalGroup;
+import org.argeo.util.directory.Organization;
+import org.argeo.util.directory.SystemPermissions;
 import org.osgi.service.useradmin.Role;
 
 /** Directory group implementation */
@@ -73,7 +77,7 @@ abstract class LdifGroup extends LdifUser implements DirectoryGroup {
                for (LdapName ldapName : getMemberNames()) {
                        Role role = findRole(ldapName);
                        if (role == null) {
-                               throw new UserDirectoryException("Role " + ldapName + " cannot be added.");
+                               throw new IllegalStateException("Role " + ldapName + " not found.");
                        }
                        directMembers.add(role);
                }
@@ -107,8 +111,8 @@ abstract class LdifGroup extends LdifUser implements DirectoryGroup {
                                roles.add(dn);
                        }
                        return roles;
-               } catch (Exception e) {
-                       throw new UserDirectoryException("Cannot get members", e);
+               } catch (NamingException e) {
+                       throw new IllegalStateException("Cannot get members", e);
                }
        }