diff --git a/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/GroupPersistence.java b/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/GroupPersistence.java index df3b657947806ec1999d84ebd8fbf00de30302b6..901413c5049db106dff1f4f01fcafce32050eb93 100755 --- a/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/GroupPersistence.java +++ b/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/GroupPersistence.java @@ -195,4 +195,20 @@ public abstract interface GroupPersistence<T extends Principal> throws UserNotFoundException, GroupNotFoundException, TransientException, AccessControlException; + /** + * Check whether the user is a member of the group. + * + * @param userID The userID. + * @param groupID The groupID. + * + * @return true or false + * + * @throws UserNotFoundException If the user is not found. + * @throws TransientException If an temporary, unexpected problem occurred. + * @throws AccessControlException If the operation is not permitted. + */ + public boolean isMember(T userID, String groupID) + throws UserNotFoundException, TransientException, + AccessControlException; + } diff --git a/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/UserPersistence.java b/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/UserPersistence.java index 94498c476244dd9d277d94900f1b9d7d2433be7f..f88faffeb2851833b99c606de1f63e317703960f 100755 --- a/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/UserPersistence.java +++ b/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/UserPersistence.java @@ -175,20 +175,4 @@ public interface UserPersistence<T extends Principal> void deleteUser(T userID) throws UserNotFoundException, TransientException, AccessControlException; - - /** - * Check whether the user is a member of the group. - * - * @param userID The userID. - * @param groupID The groupID. - * - * @return true or false - * - * @throws UserNotFoundException If the user is not found. - * @throws TransientException If an temporary, unexpected problem occurred. - * @throws AccessControlException If the operation is not permitted. - */ - boolean isMember(T userID, String groupID) - throws UserNotFoundException, TransientException, - AccessControlException; } diff --git a/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapGroupPersistence.java b/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapGroupPersistence.java index 4ba6cc65f30f79ac243f8c91a3e0e00c01d9eac5..b45f6015ed4899a961b4c6fc4356f6f561550d75 100755 --- a/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapGroupPersistence.java +++ b/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapGroupPersistence.java @@ -259,4 +259,12 @@ public class LdapGroupPersistence<T extends Principal> } } + public boolean isMember(T userID, String groupID) + throws UserNotFoundException, TransientException, + AccessControlException + { + return (new LdapUserPersistence<T>()).isMember(userID, groupID); + } + + } diff --git a/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserPersistence.java b/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserPersistence.java index 1e365d54f68c7457c08606318aa3403f9d909878..5c85dcfc43e7aa3e27bcc810fd6a7f6166936bb7 100755 --- a/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserPersistence.java +++ b/projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserPersistence.java @@ -362,7 +362,7 @@ public class LdapUserPersistence<T extends Principal> * @throws TransientException If an temporary, unexpected problem occurred. * @throws AccessControlException If the operation is not permitted. */ - public boolean isMember(T userID, String groupID) + protected boolean isMember(T userID, String groupID) throws UserNotFoundException, TransientException, AccessControlException {