Hi,

This is about DSpace 5.1.

I am trying to make a small change in the way an item is displayed. When
the user has "write" rights on the item it should display as originally.
Otherwise the item handle is passed to another web application.

I added several lines in the beginning of
org.dspace.app.xmlui.aspect.artifactbrowser.ItemViewer.addBody

Request request = ObjectModelHelper.getRequest(objectModel);
if(!AuthorizeManager.authorizeActionBoolean(context, item,
Constants.WRITE)) {
    StringBuilder redirectURL = new StringBuilder();
    redirectURL.append(request.getContextPath().replace("/xmlui",
"/dspviewerf/"));
    redirectURL.append(item.getHandle());
    redirectURL.append("?sq=");
    redirectURL.append("123");

    HttpServletResponse httpResponse =
        (HttpServletResponse)
objectModel.get(HttpEnvironment.HTTP_RESPONSE_OBJECT);
    httpResponse.sendRedirect(redirectURL.toString());
}

It works as expected for the user without "write" rights.
It works as expected for the user with "write" rights.

But after it has worked once for the user with "write" rights, it creates
cache and displays the same page for the user without "write" rights.

What can I reasonably do? Disable the cache in some way?

Best regards
Evgeni
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

Reply via email to