ldapGroup.setOwnerUser(adminUser.getId());
ldapGroup.setPriority(new LdapGroupDAO().getAll().size());
ldapGroup.setAccessUser(Access.WRITE_SYSTEM);
ldapGroup.setAccessGroup(Access.NONE);
ldapGroup.setAccessGlobal(Access.NONE);
ProfileVO profile = new ProfileVO();
profile.setAccessGlobal(Access.READ);
profile.setAccessGroup(Access.READ);
profile.setAccessUser(Access.WRITE_SYSTEM);
profile.setIpPattern("*");
profile.setTimeLock(30);
profile.setRole(new RoleDAO().getByName("User"));
profile.setDefaultUsergroup(profile.getRole().getDefaultUsergroup());
profile.setOwnerUser(adminUser.getId());
profile.setOwnerGroup(adminUser.getProfile().getDefaultUsergroup().getId());
ldapGroup.setProfile(profile);
new LdapGroupDAO().insert(ldapGroup,adminUser);
}
else
{