コード例 #1
0
  @Service
  public static void run(Thesis thesis) {
    final ThesisFile thesisFile = thesis.getDissertation();

    RoleTypeGroup scientificCouncil = new RoleTypeGroup(RoleType.SCIENTIFIC_COUNCIL);
    CurrentDegreeScientificCommissionMembersGroup commissionMembers =
        new CurrentDegreeScientificCommissionMembersGroup(thesis.getDegree());
    PersonGroup student = thesis.getStudent().getPerson().getPersonGroup();
    ThesisFileReadersGroup thesisGroup = new ThesisFileReadersGroup(thesis);

    thesisFile.setPermittedGroup(
        new GroupUnion(scientificCouncil, commissionMembers, student, thesisGroup));

    final net.sourceforge.fenixedu.domain.research.result.publication.Thesis publication =
        thesis.getPublication();
    if (publication != null) {
      for (final File file : publication.getResultDocumentFilesSet()) {
        file.setPermittedGroup(thesisFile.getPermittedGroup());
      }
    }
  }