Commit a42ea472 authored by Alinga Yeung's avatar Alinga Yeung
Browse files

Story ac2 rework. We now expose isMember() in GroupPersistence instead of in UserPersistence.

parent dea40303
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -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;
  
}
+0 −16
Original line number Diff line number Diff line
@@ -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;
}
+8 −0
Original line number Diff line number Diff line
@@ -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);
    }

  
}
+1 −1
Original line number Diff line number Diff line
@@ -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
    {