class DatawaveUsersRolesLoginModule extends UsersRolesLoginModule {

    @Override
    public boolean login() throws LoginException {
        boolean success = super.login();
        
        int roleCount = 0;
        Group[] roleSets = getRoleSets();
        if (roleSets != null) {
            for (Group roleSet : roleSets) {
                for (Enumeration<? extends Principal> e = roleSet.members(); e.hasMoreElements(); e.nextElement()) {
                    ++roleCount;
                }
            }
        }
        
        // Fail the login if there are no roles. This way we can try
        // another module potentially.
        if (roleCount == 0) {
            loginOk = false;
            success = false;
        }
        
        return success;
    }

    public  DatawaveUsersRolesLoginModule();

}