Commit 6b3f7fda authored by Alinga Yeung's avatar Alinga Yeung
Browse files

Story ac2 rework. Removed getUserGroups() from the API since we already have...

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.
parent 7db520cc
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -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.
     *
+0 −8
Original line number Diff line number Diff line
@@ -147,14 +147,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, 
               AccessControlException, UserNotFoundException,