Package org.fenixedu.bennu.core.domain

Examples of org.fenixedu.bennu.core.domain.User


            for (DegreeCurricularPlan degreeCurricularPlan : degree.getActiveDegreeCurricularPlans()) {
                for (CurricularCourse curricularCourse : degreeCurricularPlan.getCurricularCoursesSet()) {
                    for (ExecutionCourse executionCourse : curricularCourse.getAssociatedExecutionCoursesSet()) {
                        if (executionCourse.getExecutionYear().isCurrent()) {
                            for (Professorship professorship : executionCourse.getProfessorshipsSet()) {
                                User user = professorship.getPerson().getUser();
                                if (user != null) {
                                    users.add(user);
                                }
                            }
                        }
                    }
                }
            }
        }
        //by campus
        if (campus != null) {
            for (User user : RoleType.TEACHER.actualGroup().getMembers()) {
                if (user.getPerson() != null && user.getPerson().getTeacher().teachesAt(campus)) {
                    users.add(user);
                }
            }
        }
        //by department
        if (department != null) {
            for (Teacher teacher : department.getAllTeachers(getExecutionYear())) {
                User user = teacher.getPerson().getUser();
                if (user != null) {
                    users.add(user);
                }
            }
        }
        //by execution course
        if (executionCourse != null) {
            for (Professorship professorship : executionCourse.getProfessorshipsSet()) {
                User user = professorship.getPerson().getUser();
                if (user != null) {
                    users.add(user);
                }
            }
        }
View Full Code Here


    protected User getUserView(HttpServletRequest request) {
        return Authenticate.getUser();
    }

    protected Person getLoggedPerson(HttpServletRequest request) {
        final User userView = getUserView(request);
        return userView == null ? null : userView.getPerson();
    }
View Full Code Here

     */
    public ActionForward addPersonManager(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws FenixServiceException {
        PersonBean bean = (PersonBean) RenderUtils.getViewState("addPerson").getMetaObject().getObject();
        String username = bean.getUsername();
        User user;
        if (username != null && (user = User.findByUsername(username)) != null) {
            RoleType.grant(RoleType.PUBLIC_RELATIONS_OFFICE, user);
        } else {
            addActionMessage(request, "error.noUsername", (username.compareTo("") == 0 ? "(vazio)" : username));
        }
View Full Code Here

    @Override
    public Set<User> getMembers() {
        Set<User> users = new HashSet<>();
        for (Department department : project.getDeparmentsSet()) {
            for (Teacher teacher : department.getAllCurrentTeachers()) {
                User user = teacher.getPerson().getUser();
                if (user != null) {
                    users.add(user);
                }
            }
        }
View Full Code Here

            if (executionYear.isCurrent()) {
                for (final ExecutionSemester executionSemester : executionYear.getExecutionPeriodsSet()) {
                    for (final ExecutionCourse executionCourse : executionSemester.getAssociatedExecutionCoursesSet()) {
                        for (final Professorship professorship : executionCourse.getProfessorshipsSet()) {
                            if (professorship.getResponsibleFor().booleanValue()) {
                                User user = professorship.getPerson().getUser();
                                if (user != null) {
                                    users.add(user);
                                }
                            }
                        }
View Full Code Here

    @Override
    public Set<User> getMembers() {
        Set<User> users = new HashSet<>();
        for (PersonFunction f : PersonFunction.getPersonFunctions(function)) {
            if (f.isActive()) {
                User user = f.getPerson().getUser();
                if (user != null) {
                    users.add(user);
                }
            }
        }
View Full Code Here

    private static final int MAXIMUM_STUDENT_ATTENDS_PER_EXECUTION_PERIOD = 10;

    // ;

    private void checkIfReachedAttendsLimit() {
        final User userView = Authenticate.getUser();
        if (userView == null
                || !AcademicAccessRule.isProgramAccessibleToFunction(AcademicOperationType.STUDENT_ENROLMENTS, getDegree(),
                        userView.getPerson().getUser())) {
            if (readAttendsInCurrentExecutionPeriod().size() >= MAXIMUM_STUDENT_ATTENDS_PER_EXECUTION_PERIOD) {
                throw new DomainException("error.student.reached.attends.limit",
                        String.valueOf(MAXIMUM_STUDENT_ATTENDS_PER_EXECUTION_PERIOD));
            }
        }
View Full Code Here

public class GroupStudentEnrolmentDispatchAction extends FenixDispatchAction {

    public ActionForward prepareEnrolment(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws FenixActionException {

        User userView = getUserView(request);

        String studentGroupCodeString = request.getParameter("studentGroupCode");

        String shiftCodeString = request.getParameter("shiftCode");
        request.setAttribute("shiftCode", shiftCodeString);

        try {
            VerifyStudentGroupAtributes.run(null, null, studentGroupCodeString, userView.getUsername(), new Integer(1));

        } catch (NotAuthorizedException e) {
            ActionErrors actionErrors = new ActionErrors();
            ActionError error = null;
            error = new ActionError("errors.noStudentInAttendsSet");
View Full Code Here

    }

    public ActionForward enrolment(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {

        User userView = getUserView(request);

        String studentGroupCodeString = request.getParameter("studentGroupCode");

        try {

            GroupStudentEnrolment.run(studentGroupCodeString, userView.getUsername());

        } catch (NotAuthorizedException e) {
            ActionErrors actionErrors = new ActionErrors();
            ActionError error = null;
            error = new ActionError("errors.noStudentInAttendsSet");
View Full Code Here

        }
        return null;
    }

    private boolean isAuthorized(final IndividualCandidacyDocumentFile document) {
        final User user = Authenticate.getUser();
        if (user != null) {
            final Person person = user.getPerson();
            if (person.hasRole(RoleType.MANAGER) || isMobilityCoordinator(document, person)) {
                return true;
            }
        }
        return false;
View Full Code Here

TOP

Related Classes of org.fenixedu.bennu.core.domain.User

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.