Loading projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/GroupPersistence.java +20 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,8 @@ import java.security.AccessControlException; import java.security.Principal; import java.util.Collection; import com.unboundid.ldap.sdk.DN; import ca.nrc.cadc.ac.Group; import ca.nrc.cadc.ac.GroupAlreadyExistsException; import ca.nrc.cadc.ac.GroupNotFoundException; Loading Loading @@ -106,6 +108,24 @@ public abstract interface GroupPersistence<T extends Principal> throws GroupNotFoundException, TransientException, AccessControlException; /** * Get all groups the user, specified by userID, belongs to. * * @param userID The userID. * @param isAdmin return only admin Groups when true, else return non-admin * Groups. * * @return Collection of group DN. * * @throws UserNotFoundException when the user is not found. * @throws TransientException If an temporary, unexpected problem occurred. * @throws AccessControlException If the operation is not permitted. */ Collection<DN> getUserGroups(T userID, boolean isAdmin) throws UserNotFoundException, TransientException, AccessControlException; /** * Creates the group. * Loading projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/UserPersistence.java +0 −20 Original line number Diff line number Diff line Loading @@ -70,14 +70,11 @@ package ca.nrc.cadc.ac.server; import java.security.AccessControlException; import java.security.Principal; import java.util.Collection; import java.util.Map; import ca.nrc.cadc.ac.*; import ca.nrc.cadc.net.TransientException; import com.unboundid.ldap.sdk.DN; public interface UserPersistence<T extends Principal> { Loading Loading @@ -179,23 +176,6 @@ public interface UserPersistence<T extends Principal> throws UserNotFoundException, TransientException, AccessControlException; /** * Get all groups the user specified by userID belongs to. * * @param userID The userID. * @param isAdmin return only admin Groups when true, else return non-admin * Groups. * * @return Collection of group DN. * * @throws UserNotFoundException when the user is not found. * @throws TransientException If an temporary, unexpected problem occurred. * @throws AccessControlException If the operation is not permitted. */ Collection<DN> getUserGroups(T userID, boolean isAdmin) throws UserNotFoundException, TransientException, AccessControlException; /** * Check whether the user is a member of the group. * Loading projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapGroupPersistence.java +10 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,8 @@ import java.util.Collection; import org.apache.log4j.Logger; import com.unboundid.ldap.sdk.DN; import ca.nrc.cadc.ac.Group; import ca.nrc.cadc.ac.GroupAlreadyExistsException; import ca.nrc.cadc.ac.GroupNotFoundException; Loading Loading @@ -145,6 +147,14 @@ public class LdapGroupPersistence<T extends Principal> } } public Collection<DN> getUserGroups(T userID, boolean isAdmin) throws UserNotFoundException, TransientException, AccessControlException { return (new LdapUserPersistence<T>()).getUserGroups(userID, isAdmin); } public Group addGroup(Group group) throws GroupAlreadyExistsException, TransientException, AccessControlException, UserNotFoundException, Loading projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserDAO.java +3 −2 Original line number Diff line number Diff line Loading @@ -693,7 +693,8 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO } /** * Get all groups the user specified by userID belongs to. * Get all groups the user specified by userID belongs to. This method is created * to provide optimization for the LDAP server. * * @param userID The userID. * @param isAdmin Loading @@ -702,7 +703,7 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO * @throws TransientException If an temporary, unexpected problem occurred., e.getMessage( * @throws AccessControlException If the operation is not permitted. */ public Collection<DN> getUserGroups(final T userID, final boolean isAdmin) protected Collection<DN> getUserGroups(final T userID, final boolean isAdmin) throws UserNotFoundException, TransientException, AccessControlException { Loading projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserPersistence.java +3 −2 Original line number Diff line number Diff line Loading @@ -319,7 +319,8 @@ public class LdapUserPersistence<T extends Principal> } /** * Get all groups the user specified by userID belongs to. * Get all groups the user specified by userID belongs to. This method is created * to provide optimization for the LDAP server. * * @param userID The userID. * @param isAdmin return only admin Groups when true, else return non-admin Loading @@ -331,7 +332,7 @@ public class LdapUserPersistence<T extends Principal> * @throws TransientException If an temporary, unexpected problem occurred. * @throws AccessControlException If the operation is not permitted. */ public Collection<DN> getUserGroups(T userID, boolean isAdmin) protected Collection<DN> getUserGroups(T userID, boolean isAdmin) throws UserNotFoundException, TransientException, AccessControlException { LdapUserDAO<T> userDAO = null; Loading Loading
projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/GroupPersistence.java +20 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,8 @@ import java.security.AccessControlException; import java.security.Principal; import java.util.Collection; import com.unboundid.ldap.sdk.DN; import ca.nrc.cadc.ac.Group; import ca.nrc.cadc.ac.GroupAlreadyExistsException; import ca.nrc.cadc.ac.GroupNotFoundException; Loading Loading @@ -106,6 +108,24 @@ public abstract interface GroupPersistence<T extends Principal> throws GroupNotFoundException, TransientException, AccessControlException; /** * Get all groups the user, specified by userID, belongs to. * * @param userID The userID. * @param isAdmin return only admin Groups when true, else return non-admin * Groups. * * @return Collection of group DN. * * @throws UserNotFoundException when the user is not found. * @throws TransientException If an temporary, unexpected problem occurred. * @throws AccessControlException If the operation is not permitted. */ Collection<DN> getUserGroups(T userID, boolean isAdmin) throws UserNotFoundException, TransientException, AccessControlException; /** * Creates the group. * Loading
projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/UserPersistence.java +0 −20 Original line number Diff line number Diff line Loading @@ -70,14 +70,11 @@ package ca.nrc.cadc.ac.server; import java.security.AccessControlException; import java.security.Principal; import java.util.Collection; import java.util.Map; import ca.nrc.cadc.ac.*; import ca.nrc.cadc.net.TransientException; import com.unboundid.ldap.sdk.DN; public interface UserPersistence<T extends Principal> { Loading Loading @@ -179,23 +176,6 @@ public interface UserPersistence<T extends Principal> throws UserNotFoundException, TransientException, AccessControlException; /** * Get all groups the user specified by userID belongs to. * * @param userID The userID. * @param isAdmin return only admin Groups when true, else return non-admin * Groups. * * @return Collection of group DN. * * @throws UserNotFoundException when the user is not found. * @throws TransientException If an temporary, unexpected problem occurred. * @throws AccessControlException If the operation is not permitted. */ Collection<DN> getUserGroups(T userID, boolean isAdmin) throws UserNotFoundException, TransientException, AccessControlException; /** * Check whether the user is a member of the group. * Loading
projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapGroupPersistence.java +10 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,8 @@ import java.util.Collection; import org.apache.log4j.Logger; import com.unboundid.ldap.sdk.DN; import ca.nrc.cadc.ac.Group; import ca.nrc.cadc.ac.GroupAlreadyExistsException; import ca.nrc.cadc.ac.GroupNotFoundException; Loading Loading @@ -145,6 +147,14 @@ public class LdapGroupPersistence<T extends Principal> } } public Collection<DN> getUserGroups(T userID, boolean isAdmin) throws UserNotFoundException, TransientException, AccessControlException { return (new LdapUserPersistence<T>()).getUserGroups(userID, isAdmin); } public Group addGroup(Group group) throws GroupAlreadyExistsException, TransientException, AccessControlException, UserNotFoundException, Loading
projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserDAO.java +3 −2 Original line number Diff line number Diff line Loading @@ -693,7 +693,8 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO } /** * Get all groups the user specified by userID belongs to. * Get all groups the user specified by userID belongs to. This method is created * to provide optimization for the LDAP server. * * @param userID The userID. * @param isAdmin Loading @@ -702,7 +703,7 @@ public class LdapUserDAO<T extends Principal> extends LdapDAO * @throws TransientException If an temporary, unexpected problem occurred., e.getMessage( * @throws AccessControlException If the operation is not permitted. */ public Collection<DN> getUserGroups(final T userID, final boolean isAdmin) protected Collection<DN> getUserGroups(final T userID, final boolean isAdmin) throws UserNotFoundException, TransientException, AccessControlException { Loading
projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserPersistence.java +3 −2 Original line number Diff line number Diff line Loading @@ -319,7 +319,8 @@ public class LdapUserPersistence<T extends Principal> } /** * Get all groups the user specified by userID belongs to. * Get all groups the user specified by userID belongs to. This method is created * to provide optimization for the LDAP server. * * @param userID The userID. * @param isAdmin return only admin Groups when true, else return non-admin Loading @@ -331,7 +332,7 @@ public class LdapUserPersistence<T extends Principal> * @throws TransientException If an temporary, unexpected problem occurred. * @throws AccessControlException If the operation is not permitted. */ public Collection<DN> getUserGroups(T userID, boolean isAdmin) protected Collection<DN> getUserGroups(T userID, boolean isAdmin) throws UserNotFoundException, TransientException, AccessControlException { LdapUserDAO<T> userDAO = null; Loading