/** * Check that the logged in user is in a group. A #SecurityException might * be thrown at runtime if the #WikittyUser session timed out. * @param groupName the name of the group to check * @return true is the logged in user is in the group */ public boolean isMember(String groupName) { long start = TimeLog.getTime(); boolean result = false; WikittyUser user = getLoggedInUser(); //Find the group from its name Search search = Search.query() .eq(Element.ELT_EXTENSION, WikittyGroup.EXT_WIKITTYGROUP) .eq(WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME, groupName); Criteria criteria = search.criteria(); Wikitty group = findByCriteria(criteria); if (group != null && user != null) { result = WikittySecurityUtil.isMember(wikittyService, securityToken, user.getWikittyId(), group.getWikittyId()); } timeLog.log(start, "isMember"); return result; }