NIHVIVO-2492 Fix bug - pages with an empty set of required actions should not be considered as restricted.
This commit is contained in:
parent
712003ac56
commit
ef1e8eb95c
2 changed files with 8 additions and 9 deletions
|
@ -102,7 +102,9 @@ public class VitroHttpServlet extends HttpServlet {
|
||||||
protected boolean isAuthorizedToDisplayPage(HttpServletRequest request,
|
protected boolean isAuthorizedToDisplayPage(HttpServletRequest request,
|
||||||
HttpServletResponse response, Actions actions) {
|
HttpServletResponse response, Actions actions) {
|
||||||
// Record restricted pages so we won't return to them on logout
|
// Record restricted pages so we won't return to them on logout
|
||||||
LogoutRedirector.recordRestrictedPageUri(request);
|
if (!actions.isEmpty()) {
|
||||||
|
LogoutRedirector.recordRestrictedPageUri(request);
|
||||||
|
}
|
||||||
|
|
||||||
if (PolicyHelper.isAuthorizedForActions(request, actions)) {
|
if (PolicyHelper.isAuthorizedForActions(request, actions)) {
|
||||||
log.debug("Servlet '" + this.getClass().getSimpleName()
|
log.debug("Servlet '" + this.getClass().getSimpleName()
|
||||||
|
|
|
@ -86,15 +86,12 @@ public class FreemarkerHttpServlet extends VitroHttpServlet {
|
||||||
Configuration config = getConfig(vreq);
|
Configuration config = getConfig(vreq);
|
||||||
vreq.setAttribute("freemarkerConfig", config);
|
vreq.setAttribute("freemarkerConfig", config);
|
||||||
|
|
||||||
ResponseValues responseValues;
|
// This method does a redirect if the required authorizations are not met, so just return.
|
||||||
|
if (!isAuthorizedToDisplayPage(request, response, requiredActions(vreq))) {
|
||||||
// This method does a redirect if the required authorizations are not met, so just return.
|
return;
|
||||||
if (!isAuthorizedToDisplayPage(request, response, requiredActions(vreq))) {
|
}
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
responseValues = processRequest(vreq);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
ResponseValues responseValues = processRequest(vreq);
|
||||||
doResponse(vreq, response, responseValues);
|
doResponse(vreq, response, responseValues);
|
||||||
|
|
||||||
} catch (TemplateProcessingException e) {
|
} catch (TemplateProcessingException e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue