예제 #1
0
 @Override
 public boolean isMember(Person person) {
   return (person != null
       && person.hasEmployee()
       && checkParentUnits(
           getObject(), Collections.singletonList(person.getEmployee().getCurrentWorkingPlace())));
   // return (person != null && person.hasEmployee() && getObject() ==
   // person.getEmployee().getCurrentDepartmentWorkingPlace()
   // .getDepartmentUnit());
 }
 private Person checkUser() {
   Person person = AccessControl.getPerson();
   Unit ciistUnit =
       Unit.readByCostCenterCode(
           FenixConfigurationManager.getConfiguration().getCIISTCostCenterCode());
   Unit currentWorkingPlace = person.getEmployee().getCurrentWorkingPlace();
   if ((currentWorkingPlace != null && ciistUnit != null && !currentWorkingPlace.equals(ciistUnit))
       || person.getPersonRole(RoleType.MANAGER) == null) {
     throw new DomainException("What you want do do hein?!?!");
   }
   return person;
 }
  private void loadIndexes() {
    for (final Party party : RootDomainObject.getInstance().getPartysSet()) {
      if (party.isPerson()) {
        final Person person = (Person) party;
        try {
          final String personName = CardGenerationEntry.normalizePersonName(person).trim();
          addPerson(peopleByName, person, personName);

          if (person.hasEmployee()) {
            final Integer number = person.getEmployee().getEmployeeNumber();
            addPerson(peopleByNumber, person, number);
          }
          if (person.hasStudent()) {
            final Integer number = person.getStudent().getNumber();
            addPerson(peopleByNumber, person, number);
          }
        } catch (Error e) {
          // keep going... ignore the person for now.
          peopleWithBadNames.add(person);
        }
      }
    }
  }
 private Department getPersonDepartment() {
   final User userView = getUserView();
   final Person person = userView == null ? null : userView.getPerson();
   final Employee employee = person == null ? null : person.getEmployee();
   return employee == null ? null : employee.getCurrentDepartmentWorkingPlace();
 }