Package org.fenixedu.bennu.core.domain

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


        } else if (showOccupation instanceof InfoOccupation) {

            InfoOccupation infoGenericEvent = (InfoOccupation) showOccupation;
            strBuffer.append("<span title=\"").append(infoGenericEvent.getDescription()).append("\">");
            final User userView = Authenticate.getUser();
            if (infoGenericEvent.getOccupation().isActive() && userView != null
                    && userView.getPerson().hasRole(RoleType.RESOURCE_ALLOCATION_MANAGER)) {
                strBuffer.append("<a href=\"");
                strBuffer.append(context).append("/resourceAllocationManager/");
                strBuffer.append("roomsPunctualScheduling.do?method=prepareView&genericEventID=")
                        .append(infoGenericEvent.getExternalId()).append("\">");
                strBuffer.append(infoGenericEvent.getTitle());
View Full Code Here


        } else if (showOccupation instanceof InfoOccupation) {

            InfoOccupation infoGenericEvent = (InfoOccupation) showOccupation;
            strBuffer.append("<span title=\"").append(infoGenericEvent.getDescription()).append("\">");
            final User userView = Authenticate.getUser();
            if (infoGenericEvent.getOccupation().isActive() && userView != null
                    && userView.getPerson().hasRole(RoleType.RESOURCE_ALLOCATION_MANAGER)) {
                strBuffer.append("<a href=\"");
                strBuffer.append(context).append("/resourceAllocationManager/");
                strBuffer.append("roomsPunctualScheduling.do?method=prepareView&genericEventID=")
                        .append(infoGenericEvent.getExternalId()).append("\">");
                strBuffer.append(infoGenericEvent.getTitle());
View Full Code Here

    public ActionForward insertStudentInShift(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws FenixActionException {
        PersonBean bean = getRenderedObject("personBean");
        String id = bean.getUsername();
        Person person = null;
        final User user = User.findByUsername(id);
        if (user != null) {
            person = user.getPerson();
        } else {
            try {
                final Student student = Student.readStudentByNumber(Integer.valueOf(id));
                if (student != null) {
                    person = student.getPerson();
View Full Code Here

* @version $Id$
*/
public class AccessControl {

    static public Person getPerson() {
        final User userView = Authenticate.getUser();
        return userView == null ? null : userView.getPerson();
    }
View Full Code Here

public class RolePredicates {

    public static class PartyContactPredicate implements AccessControlPredicate<PartyContact> {

        private static boolean isSelfPerson(Party person) {
            final User userView = Authenticate.getUser();
            return userView.getPerson() != null && userView.getPerson().equals(person);
        }
View Full Code Here

            HttpServletResponse response) {

        final SortedSet<GenericApplicationPeriod> periods = GenericApplicationPeriod.getPeriods();
        request.setAttribute("periods", periods);

        final User userView = Authenticate.getUser();
        if (userView != null && userView.getPerson().hasRole(RoleType.MANAGER)) {
            final GenericApplicationPeriodBean genericApplicationPeriodBean = new GenericApplicationPeriodBean();
            request.setAttribute("genericApplicationPeriodBean", genericApplicationPeriodBean);
        }

        return mapping.findForward("genericApplications.listApplicationPeriods");
View Full Code Here

    }

    public ActionForward removeManager(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {
        final GenericApplicationPeriod applicationPeriod = getDomainObject(request, "applicationPeriodId");
        final User user = getDomainObject(request, "userId");
        applicationPeriod.removeManagerService(user);
        request.setAttribute("changedManagerList", Boolean.TRUE);
        return viewApplicationPeriod(mapping, form, request, response);
    }
View Full Code Here

public class RegenerateDocumentsDA extends FenixDispatchAction {

    public ActionForward doOperation(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        try {
            User user = User.findByUsername("ist24439");
            Authenticate.mock(user);
            return new DegreeCandidacyManagementDispatchAction().doOperation(mapping, form, request, response);
        } finally {
            Authenticate.unmock();
        }
View Full Code Here

    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        String info = request.getParameter("user");
        if (info != null) {
            User u = User.findByUsername(info);
            HashMap<Registration, String> hm = new HashMap<>();
            if (u.getPerson().getStudent() != null) {
                for (Registration registration : u.getPerson().getStudent().getActiveRegistrations()) {
                    hm.put(registration,
                            "<b>Classes: </b>"
                                    + StringEscapeUtils.escapeHtml(ICalStudentTimeTable.getUrl("syncClasses", registration,
                                            request))
                                    + "<br/>"
View Full Code Here

public class CurricularCourseEquivalenciesDA extends FenixDispatchAction {

    @EntryPoint
    public ActionForward prepare(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        final User userView = Authenticate.getUser();
        final DynaActionForm actionForm = (DynaActionForm) form;

        setInfoDegreesToManage(request, userView);

        final String degreeIDString = (String) actionForm.get("degreeID");
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.