From 6b3f7fdac298bcd8b793fbcc08218c23b64c7cb4 Mon Sep 17 00:00:00 2001
From: Alinga Yeung <Alinga.Yeung@nrc-cnrc.gc.ca>
Date: Tue, 11 Aug 2015 13:44:11 -0700
Subject: [PATCH] Story ac2 rework. Removed getUserGroups() from the API since
 we already have getGroups(). This also stops us from exposing
 com.unboundid.ldap.sdk.DN to the API.

---
 .../nrc/cadc/ac/server/GroupPersistence.java  | 20 -------------------
 .../ac/server/ldap/LdapGroupPersistence.java  |  8 --------
 2 files changed, 28 deletions(-)

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 901413c5..02fd29bb 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
@@ -72,8 +72,6 @@ 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;
@@ -108,24 +106,6 @@ 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.
      *
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 b45f6015..1169ecc5 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
@@ -146,14 +146,6 @@ 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, 
-- 
GitLab