private void prepareTravelerRole() { Role role = service.findRoleByName(TRAVELER_ROLE); if (role == null) { logger.info("Adding role '" + TRAVELER_ROLE + "'."); role = new Role(); role.setName(TRAVELER_ROLE); role.setDescription("Traveler"); service.addRole(role); } else { logger.info("Role '" + TRAVELER_ROLE + "' already present."); } }
private void prepareAdminRole() { Role role = service.findRoleByName(ADMIN_ROLE); if (role == null) { logger.info("Adding role '" + ADMIN_ROLE + "'."); role = new Role(); role.setName(ADMIN_ROLE); role.setDescription("Application administrator"); service.addRole(role); } else { logger.info("Role '" + ADMIN_ROLE + "' already present."); } }