Ejemplo n.º 1
0
    public static boolean eval(Person contactPerson) {
      if (hasRole(RoleType.OPERATOR)
          || hasRole(RoleType.MANAGER)
          || isSelfPerson(contactPerson)
          || hasRole(RoleType.PERSONNEL_SECTION)) {
        return true;
      }

      if (contactPerson.getStudent() != null
          && !contactPerson.hasRole(RoleType.GRANT_OWNER)
          && !contactPerson.hasRole(RoleType.EMPLOYEE)) {
        return AcademicAuthorizationGroup.get(AcademicOperationType.EDIT_STUDENT_PERSONAL_DATA)
            .isMember(Authenticate.getUser());
      }

      return false;
    }
 public SortedSet<OutboundMobilityCandidacyContestGroup> getCandidacyContestGroupSet(
     final OutboundMobilityCandidacyPeriod period) {
   final User user = Authenticate.getUser();
   if (AcademicAuthorizationGroup.get(AcademicOperationType.MANAGE_MOBILITY_OUTBOUND)
       .isMember(user)) {
     return period.getOutboundMobilityCandidacyContestGroupSet();
   }
   final SortedSet<OutboundMobilityCandidacyContestGroup> result =
       new TreeSet<OutboundMobilityCandidacyContestGroup>();
   if (user != null && user.getPerson() != null) {
     for (final OutboundMobilityCandidacyContestGroup group :
         user.getPerson().getOutboundMobilityCandidacyContestGroupSet()) {
       if (hasContestForPeriod(period, group)) {
         result.add(group);
       }
     }
   }
   return result;
 }