Exemplo n.º 1
0
 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.");
   }
 }
Exemplo n.º 2
0
 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.");
   }
 }