// certificate, such as batch tool etc
if (AdminGroupData.findByGroupName(entityManager, AdminGroup.DEFAULTGROUPNAME) == null) {
LOG.debug("initialize: FinderEx, add default group.");
// Add Default Special Admin Group
try {
final AdminGroupData agdl = new AdminGroupData(Integer.valueOf(findFreeAdminGroupId()), AdminGroup.DEFAULTGROUPNAME);
entityManager.persist(agdl);
final ArrayList<AdminEntity> adminentities = new ArrayList<AdminEntity>();
adminentities.add(new AdminEntity(AdminEntity.SPECIALADMIN_BATCHCOMMANDLINEADMIN));
adminentities.add(new AdminEntity(AdminEntity.SPECIALADMIN_CACOMMANDLINEADMIN));
adminentities.add(new AdminEntity(AdminEntity.SPECIALADMIN_RAADMIN));
adminentities.add(new AdminEntity(AdminEntity.SPECIALADMIN_INTERNALUSER));
agdl.addAdminEntities(entityManager, adminentities);
final ArrayList<AccessRule> accessrules = new ArrayList<AccessRule>();
accessrules.add(new AccessRule(AccessRulesConstants.ROLE_ADMINISTRATOR, AccessRule.RULE_ACCEPT, true));
accessrules.add(new AccessRule(AccessRulesConstants.ROLE_SUPERADMINISTRATOR, AccessRule.RULE_ACCEPT, false));
accessrules.add(new AccessRule(AccessRulesConstants.REGULAR_CAFUNCTIONALTY, AccessRule.RULE_ACCEPT, true));
accessrules.add(new AccessRule(AccessRulesConstants.REGULAR_RAFUNCTIONALITY, AccessRule.RULE_ACCEPT, true));
accessrules.add(new AccessRule(AccessRulesConstants.REGULAR_LOGFUNCTIONALITY, AccessRule.RULE_ACCEPT, true));
accessrules.add(new AccessRule(AccessRulesConstants.REGULAR_SYSTEMFUNCTIONALITY, AccessRule.RULE_ACCEPT, true));
accessrules.add(new AccessRule(AccessRulesConstants.HARDTOKEN_HARDTOKENFUNCTIONALITY, AccessRule.RULE_ACCEPT, true));
accessrules.add(new AccessRule(AccessRulesConstants.CABASE, AccessRule.RULE_ACCEPT, true));
accessrules.add(new AccessRule(AccessRulesConstants.ENDENTITYPROFILEBASE, AccessRule.RULE_ACCEPT, true));
agdl.addAccessRules(entityManager, accessrules);
authTreeSession.signalForAuthorizationTreeUpdate();
} catch (Exception ce) {
LOG.error("initialize continues after Exception: ", ce);
}
}
// Add Public Web Group
final AdminGroupData agl = AdminGroupData.findByGroupName(entityManager, AdminGroup.PUBLICWEBGROUPNAME);
if (agl == null) {
LOG.debug("initialize: Can't find public web group");
try {
final AdminGroupData agdl = new AdminGroupData(Integer.valueOf(findFreeAdminGroupId()), AdminGroup.PUBLICWEBGROUPNAME);
entityManager.persist(agdl);
addDefaultPublicWebGroupRules(agdl);
authTreeSession.signalForAuthorizationTreeUpdate();
} catch (Exception ce) {
LOG.error("initialize continues after Exception: ", ce);