private boolean isMember(Principal userID, String groupName, Role role) throws UserNotFoundException, AccessControlException, IOException { Group group = getMembership(groupName, role); return group != null; }
/** * Return the group, specified by parameter groupName, if the user, * identified by userID, is a member of that group. Return null * otherwise. * * This call is identical to getMemberShip(userID, groupName, Role.MEMBER) * * @param groupName Identifies the group. * @return The group or null of the user is not a member. * @throws UserNotFoundException If the user does not exist. * @throws AccessControlException If not allowed to peform the search. * @throws IllegalArgumentException If a parameter is null. * @throws IOException If an unknown error occured. */ public Group getMembership(String groupName) throws UserNotFoundException, AccessControlException, IOException { return getMembership(groupName, Role.MEMBER); }