X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Fosgi%2Fuseradmin%2FLdifGroup.java;h=72b08a8c3d0fc59c78fd3a0f3dc35ec45a0ffbd1;hb=d74f9b604d0132a6b66c7a2dc189be2c2798b7c4;hp=b7167ea134684bacf63b25618446e8b198db27a5;hpb=ddc70245fe7413b7341205914c91015600726b4a;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.util/src/org/argeo/osgi/useradmin/LdifGroup.java b/org.argeo.util/src/org/argeo/osgi/useradmin/LdifGroup.java index b7167ea13..72b08a8c3 100644 --- a/org.argeo.util/src/org/argeo/osgi/useradmin/LdifGroup.java +++ b/org.argeo.util/src/org/argeo/osgi/useradmin/LdifGroup.java @@ -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); } }