Examples of EPerson


Examples of org.dspace.eperson.EPerson

  @Override
  protected Map referenceData(HttpServletRequest request) throws Exception {
    Map<String, Object> model = new HashMap<String, Object>();
    Context context = UIUtil.obtainContext(request);
    EPerson currUser = context.getCurrentUser();
    boolean isAdmin = AuthorizeManager.isAdmin(context);
    if (currUser != null) {
      model.put("researcher_page_menu", new Boolean(true));
    }
    if (isAdmin) {
View Full Code Here

Examples of org.dspace.eperson.EPerson

                    getSpecificPartPath() + " page not found");
            return null;
        }

        Context context = UIUtil.obtainContext(request);
        EPerson currentUser = context.getCurrentUser();
        if ((dyn.getStatus() == null || dyn.getStatus().booleanValue() == false)
                && !AuthorizeManager.isAdmin(context))
        {
           
            if (currentUser != null
View Full Code Here

Examples of org.dspace.eperson.EPerson

        String id_s = request.getParameter("id");
        Integer id = Integer.parseInt(id_s);
        ResearcherPage researcher = getApplicationService().get(
                    ResearcherPage.class, id);
        Context context = UIUtil.obtainContext(request);
        EPerson currUser = context.getCurrentUser();
        if (AuthorizeManager.isAdmin(context)
                || (researcher.getEpersonID()!=null && currUser != null && researcher.getEpersonID().equals(
                        currUser.getID())))
        {
            reference.put("researcher_page_menu", new Boolean(true));
            reference.put("researcher", researcher);        
        }
        reference.put("authority_key", ResearcherPageUtils
View Full Code Here

Examples of org.dspace.eperson.EPerson

    }

    private boolean isAdmin(Context context, HttpServletRequest request)
            throws SQLException, ServletException
    {
        EPerson currUser = getCurrentUser(request);
        if (currUser == null)
        {
            throw new ServletException(
                    "Wrong data or configuration: access to the my rp servlet without a valid user: there is no user logged in");
        }
View Full Code Here

Examples of org.dspace.eperson.EPerson

    private EPerson getCurrentUser(HttpServletRequest request)
            throws SQLException
    {
        Context context = UIUtil.obtainContext(request);
        EPerson currUser = context.getCurrentUser();
        return currUser;
    }
View Full Code Here

Examples of org.dspace.eperson.EPerson

                    "Researcher page not found");
            return null;
        }

        Context context = UIUtil.obtainContext(request);
        EPerson currUser = context.getCurrentUser();

        boolean isAdmin = AuthorizeManager.isAdmin(context);
     
        if (isAdmin
                || (currUser != null && (researcher.getEpersonID() != null && currUser
                        .getID() == researcher.getEpersonID())))
        {
            model.put("researcher_page_menu", new Boolean(true));
            model.put("authority_key",
                    ResearcherPageUtils.getPersistentIdentifier(researcher));

            if (isAdmin)
            {
                AuthorityDAO dao = AuthorityDAOFactory.getInstance(context);
                long pendingItems = dao
                        .countIssuedItemsByAuthorityValueInAuthority(
                                RPAuthority.RP_AUTHORITY_NAME,
                                ResearcherPageUtils
                                        .getPersistentIdentifier(researcher));
                model.put("pendingItems", new Long(pendingItems));
            }
        }
       
        else if ((researcher.getStatus() == null || researcher.getStatus()
                .booleanValue() == false))
        {
            if (context.getCurrentUser() != null
                    || Authenticate.startAuthentication(context, request,
                            response))
            {
                // Log the error
                log.info(LogManager
                        .getHeader(context, "authorize_error",
                                "Only system administrator can access to disabled researcher page"));

                JSPManager
                        .showAuthorizeError(
                                request,
                                response,
                                new AuthorizeException(
                                        "Only system administrator can access to disabled researcher page"));
            }
            return null;
        }

       
        if (subscribeService != null)
        {
            boolean subscribed = subscribeService.isSubscribed(currUser,
                    researcher);
            model.put("subscribed", subscribed);
            EPerson eperson = EPerson.findByNetid(context, researcher.getSourceID());
            if (eperson != null) {
              model.put("subscriptions", subscribeService.getSubscriptions(eperson));
            }
        }
View Full Code Here

Examples of org.dspace.eperson.EPerson

            return null;
        }
        // check admin authorization
        Boolean isAdmin = null; // anonymous access
        Context context = UIUtil.obtainContext(request);
        EPerson currUser = context.getCurrentUser();
        if (AuthorizeManager.isAdmin(context))
        {
            isAdmin = true; // admin
        }
        else if ((currUser != null && researcher.getId() == currUser.getID()))
        {
            isAdmin = false; // owner
        }
        List<TabResearcherPage> tabs = applicationService.getTabsByVisibility(
                TabResearcherPage.class, isAdmin);
View Full Code Here

Examples of org.dspace.eperson.EPerson

    }

    private ResearcherPage getMyResearcherPage(HttpServletRequest request)
            throws SQLException, ServletException
    {
        EPerson currUser = getCurrentUser(request);
        if (currUser == null)
        {
            throw new ServletException(
                    "Wrong data or configuration: access to the my rp servlet without a valid user: there is no user logged in");
        }

        int id = currUser.getID();
        ResearcherPage rp = applicationService.getResearcherPageByEPersonId(id);
        return rp;
    }
View Full Code Here

Examples of org.dspace.eperson.EPerson

    private EPerson getCurrentUser(HttpServletRequest request)
            throws SQLException
    {
        Context context = UIUtil.obtainContext(request);
        EPerson currUser = context.getCurrentUser();
        return currUser;
    }
View Full Code Here

Examples of org.dspace.eperson.EPerson

            return null;
        }

        Context context = UIUtil.obtainContext(request);

        EPerson currentUser = context.getCurrentUser();
       
        if ((grant.getStatus() == null || grant.getStatus().booleanValue() == false)
                && !AuthorizeManager.isAdmin(context))
        {
           
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.