NIHVIVO-736 transitioning from LoginFormBean to LoginStatusBean.

This commit is contained in:
jeb228 2010-10-07 20:52:57 +00:00
parent 659a5b41df
commit c2fa36316f
2 changed files with 8 additions and 11 deletions

View file

@ -45,7 +45,7 @@ public class LoginStatusBean {
// ----------------------------------------------------------------------
/**
* Attach this bean to the session.
* Attach this bean to the session - this means you are logged in.
*/
public static void setBean(HttpSession session, LoginStatusBean lsb) {
session.setAttribute(ATTRIBUTE_NAME, lsb);

View file

@ -4,7 +4,7 @@
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.VClass" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditConfiguration" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.edit.n3editing.EditSubmission" %>
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %>
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest"%>
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary" %>
@ -51,16 +51,13 @@ if (entity == null){
throw new JspException(e);
}
if (VitroRequestPrep.isSelfEditing(request) || LoginFormBean.loggedIn(request, LoginFormBean.NON_EDITOR) /* minimum level*/) {
request.setAttribute("showSelfEdits",Boolean.TRUE);
}%>
<c:if test="${sessionScope.loginHandler != null &&
sessionScope.loginHandler.loginStatus == 'authenticated' &&
sessionScope.loginHandler.loginRole >= LoginFormBean.NON_EDITOR}">
<c:set var="showCuratorEdits" value="${true}"/>
</c:if>
boolean showSelfEdits = VitroRequestPrep.isSelfEditing(request);
boolean showCuratorEdits = LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.CURATOR);
if (showSelfEdits || showCuratorEdits) {
request.setAttribute("showEdits",Boolean.TRUE);
}
%>
<c:set var="showEdits" value="${showSelfEdits || showCuratorEdits}" scope="request"/>
<c:set var="editingClass" value="${showEdits ? 'editing' : ''}" scope="request"/>
<c:set var="themeDir"><c:out value="${portalBean.themeDir}" /></c:set>