Package org.fenixedu.bennu.core.groups

Examples of org.fenixedu.bennu.core.groups.Group


    @Atomic
    public static void run(DegreeCurricularPlan degreeCurricularPlan, String[] add, String[] remove) {
        check(RolePredicates.SCIENTIFIC_COUNCIL_PREDICATE);

        Group original = degreeCurricularPlan.getCurricularPlanMembersGroup();

        Group changed = original;
        if (add != null) {
            for (String personID : add) {
                Person person = FenixFramework.getDomainObject(personID);
                changed = changed.grant(person.getUser());
            }
        }
        if (remove != null) {
            for (String personID : remove) {
                Person person = FenixFramework.getDomainObject(personID);
                changed = changed.revoke(person.getUser());
            }
        }

        updateBolonhaManagerRoleToGroupDelta(degreeCurricularPlan, original, changed);
        degreeCurricularPlan.setCurricularPlanMembersGroup(changed);
View Full Code Here


            }
        }

        Collection<Department> departments = Bennu.getInstance().getDepartmentsSet();
        for (Department department : departments) {
            Group group = department.getCompetenceCourseMembersGroup();
            if (group != null && group.isMember(person.getUser())) {
                return true;
            }
        }

        return false;
View Full Code Here

        final Collection<Person> people = new ArrayList<Person>();
        for (final Attends attends : studentGroup.getAttendsSet()) {
            final Person person = attends.getRegistration().getPerson();
            people.add(person);
        }
        final Group fixedSetGroup = UserGroup.of(Person.convertToUsers(people));
        final Recipient recipient = new Recipient("", fixedSetGroup);
        final Collection<Recipient> recipients = new ArrayList<Recipient>();
        recipients.add(recipient);

        Registration registration = Registration.readByUsername(userName);
View Full Code Here

        this.degrees = degrees;
    }

    @Atomic
    public void createRecipientGroup(Sender sender) {
        Group group = NobodyGroup.get();
        for (Degree degree : getDegrees()) {
            group = group.or(StudentsConcludedInExecutionYearGroup.get(degree, getEndExecutionYear()));
        }
        sender.addRecipients(Recipient.newInstance(group));
    }
View Full Code Here

        this.personalDataInfo = personalDataInfo;
    }

    @Atomic
    public void createRecipientGroup(Sender sender) {
        Group recipientsGroup =
                NotUpdatedAlumniInfoForSpecificDaysGroup.get(getDaysNotUpdated(), getProfessionalInfo(), getFormationInfo(),
                        getPersonalDataInfo());
        Recipient recipients = Recipient.newInstance(recipientsGroup);
        sender.addRecipients(recipients);
    }
View Full Code Here

        if (getSelectedDepartmentUnit() == null || getSelectedDepartmentUnit().getDepartment() == null
                || getSelectedDepartmentUnit().getDepartment().getCompetenceCourseMembersGroup() == null) {
            return result;
        }

        Group competenceCoursesManagementGroup = getSelectedDepartmentUnit().getDepartment().getCompetenceCourseMembersGroup();
        if (competenceCoursesManagementGroup != null) {
            result = new ArrayList<String>();

            for (User user : competenceCoursesManagementGroup.getMembers()) {
                result.add(user.getPerson().getName() + " (" + user.getUsername() + ")");
            }
        }

        return result;
View Full Code Here

        if (getMembers() == null) {
            return "";
        }

        StringBuilder builder = new StringBuilder();
        Group membersGroup = getMembers();

        Set<User> elements = membersGroup.getMembers();

        for (User user : elements) {
            builder.append(user.getPerson().getName()).append(" (").append(user.getPerson().getEmailForSendingEmails())
                    .append(")").append("\n");
        }
View Full Code Here

    public String createFromName() {
        return String.format("%s (%s)", Unit.getInstitutionAcronym(), "Sistema Fénix");
    }

    public Recipient getRoleRecipient(RoleType roleType) {
        final Group roleGroup = roleType.actualGroup();
        for (Recipient recipient : getRecipientsSet()) {
            final Group members = recipient.getMembers();
            if (roleGroup.equals(members)) {
                return recipient;
            }
        }
        return createRoleRecipient(roleGroup);
View Full Code Here

        super();
        setDegree(degree);
        setFromAddress(Sender.getNoreplyMail());
        addReplyTos(new CurrentUserReplyTo());
        setMembers(CoordinatorGroup.get(degree));
        Group current = CoordinatorGroup.get(degree);
        Group teachers = TeacherGroup.get(degree);
        Group students = StudentGroup.get(degree, null);
        for (CycleType cycleType : degree.getDegreeType().getCycleTypes()) {
            addRecipients(createRecipient(StudentGroup.get(degree, cycleType)));
        }
        addRecipients(createRecipient(current));
        addRecipients(createRecipient(teachers));
View Full Code Here

        if (SpaceUtils.personIsSpacesAdministrator(user.getPerson()) || r.getManagementGroupWithChainOfResponsability() != null
                && r.getManagementGroupWithChainOfResponsability().isMember(user)) {
            return;
        }

        final Group group = getAccessGroup();
        if (group != null && group.isMember(user)) {
            return;
        }

        throw new DomainException("error.logged.person.not.authorized.to.make.operation");
    }
View Full Code Here

TOP

Related Classes of org.fenixedu.bennu.core.groups.Group

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.