NIHVIVO-736 transitioning from LoginFormBean to LoginStatusBean.

This commit is contained in:
jeb228 2010-10-13 20:46:41 +00:00
parent c4488e0366
commit 18de61ca20
10 changed files with 19 additions and 27 deletions

View file

@ -8,7 +8,6 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import edu.cornell.mannlib.vedit.beans.LoginFormBean;
import edu.cornell.mannlib.vitro.webapp.auth.identifier.ArrayIdentifierBundle; import edu.cornell.mannlib.vitro.webapp.auth.identifier.ArrayIdentifierBundle;
import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle; import edu.cornell.mannlib.vitro.webapp.auth.identifier.IdentifierBundle;
import edu.cornell.mannlib.vitro.webapp.auth.identifier.ServletIdentifierBundleFactory; import edu.cornell.mannlib.vitro.webapp.auth.identifier.ServletIdentifierBundleFactory;
@ -18,16 +17,8 @@ import edu.cornell.mannlib.vitro.webapp.auth.policy.ServletPolicyList;
import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.Authorization; import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.Authorization;
import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.PolicyDecision; import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.PolicyDecision;
import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.PolicyIface; import edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.PolicyIface;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.AddDataPropStmt;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.DropObjectPropStmt;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.EditObjPropStmt;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestActionConstants;
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction; import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces.RequestedAction;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.ImageUploadController;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
import edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep;
public class AuthorizationHelper { public class AuthorizationHelper {

View file

@ -72,7 +72,7 @@ public class BaseResourceBean implements ResourceBean {
if( level == LoginStatusBean.ANYBODY) // 0 if( level == LoginStatusBean.ANYBODY) // 0
return PUBLIC; return PUBLIC;
if( level == LoginStatusBean.NON_EDITOR) // 1 if( level == LoginStatusBean.NON_EDITOR) // 1
return PUBLIC; // no correspondence with self-editing, which does not authorize through the LoginFormBean return PUBLIC; // no correspondence with self-editing, which does not authorize through the LoginStatusBean
if( level == LoginStatusBean.EDITOR ) // 4 if( level == LoginStatusBean.EDITOR ) // 4
return EDITOR; return EDITOR;
if( level == LoginStatusBean.CURATOR ) // 5 if( level == LoginStatusBean.CURATOR ) // 5

View file

@ -19,9 +19,7 @@ import com.hp.hpl.jena.vocabulary.RDF;
import edu.cornell.mannlib.vedit.beans.EditProcessObject; import edu.cornell.mannlib.vedit.beans.EditProcessObject;
import edu.cornell.mannlib.vedit.beans.FormObject; import edu.cornell.mannlib.vedit.beans.FormObject;
import edu.cornell.mannlib.vedit.beans.LoginFormBean;
import edu.cornell.mannlib.vedit.controller.BaseEditController; import edu.cornell.mannlib.vedit.controller.BaseEditController;
import edu.cornell.mannlib.vitro.webapp.auth.policy.JenaNetidPolicy.ContextSetup;
import edu.cornell.mannlib.vitro.webapp.beans.Portal; import edu.cornell.mannlib.vitro.webapp.beans.Portal;
import edu.cornell.mannlib.vitro.webapp.beans.VClass; import edu.cornell.mannlib.vitro.webapp.beans.VClass;
import edu.cornell.mannlib.vitro.webapp.beans.VClassGroup; import edu.cornell.mannlib.vitro.webapp.beans.VClassGroup;

View file

@ -26,7 +26,6 @@ import com.hp.hpl.jena.rdf.model.ModelMaker;
import com.hp.hpl.jena.shared.JenaException; import com.hp.hpl.jena.shared.JenaException;
import com.hp.hpl.jena.shared.Lock; import com.hp.hpl.jena.shared.Lock;
import edu.cornell.mannlib.vedit.beans.LoginFormBean;
import edu.cornell.mannlib.vedit.beans.LoginStatusBean; import edu.cornell.mannlib.vedit.beans.LoginStatusBean;
import edu.cornell.mannlib.vedit.controller.BaseEditController; import edu.cornell.mannlib.vedit.controller.BaseEditController;
import edu.cornell.mannlib.vitro.webapp.beans.Portal; import edu.cornell.mannlib.vitro.webapp.beans.Portal;

View file

@ -7,7 +7,7 @@
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %><%/* this odd thing points to something in web.xml */ %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %><%/* this odd thing points to something in web.xml */ %>
<%@ page errorPage="/error.jsp"%> <%@ page errorPage="/error.jsp"%>
<%@page import="com.hp.hpl.jena.vocabulary.OWL"%><jsp:useBean id="loginHandler" class="edu.cornell.mannlib.vedit.beans.LoginFormBean" scope="session" /> <%@page import="com.hp.hpl.jena.vocabulary.OWL"%>
<% /*********************************************** <% /***********************************************
Display Browse Results (the "Index" menu command) Display Browse Results (the "Index" menu command)

View file

@ -12,7 +12,6 @@ String headerStr = (String)request.getAttribute("header");
if ( headerStr == null || (!headerStr.equalsIgnoreCase("noheader")) ) { %> if ( headerStr == null || (!headerStr.equalsIgnoreCase("noheader")) ) { %>
<% } %> <% } %>
<jsp:useBean id="results" class="java.util.ArrayList" scope="request" /> <jsp:useBean id="results" class="java.util.ArrayList" scope="request" />
<jsp:useBean id="loginHandler" class="edu.cornell.mannlib.vedit.beans.LoginFormBean" scope="session"/>
<% <%
int rows = 0; int rows = 0;

View file

@ -8,13 +8,20 @@
version="2.0"> */ %> version="2.0"> */ %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %>
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
<%
if (LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.EDITOR)) {
request.setAttribute("isEditor", Boolean.TRUE);
}
%>
<c:set var="singlePortal" value="${requestScope.singlePortal}"/> <c:set var="singlePortal" value="${requestScope.singlePortal}"/>
<div name="anybody" class="editingForm"> <div name="anybody" class="editingForm">
<jsp:include page="/templates/edit/fetch/vertical.jsp"/> <jsp:include page="/templates/edit/fetch/vertical.jsp"/>
<c:set var='individual' value='${requestScope.entityWebapp}'/> <c:set var='individual' value='${requestScope.entityWebapp}'/>
<jsp:useBean id="loginHandler" class="edu.cornell.mannlib.vedit.beans.LoginFormBean" scope="session" />
<c:if test="${loginHandler.loginRole >= 4}"> <c:if test="${isEditor}">
<div name="authorized" align="center"> <div name="authorized" align="center">
<table class="form-background" border="0" cellpadding="2" cellspacing="2" width="100%"> <table class="form-background" border="0" cellpadding="2" cellspacing="2" width="100%">
<tr valign="top" align="center"> <tr valign="top" align="center">

View file

@ -3,7 +3,7 @@
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://vitro.mannlib.cornell.edu/vitro/tags/PropertyEditLink" prefix="edLnk" %> <%@ taglib uri="http://vitro.mannlib.cornell.edu/vitro/tags/PropertyEditLink" prefix="edLnk" %>
<%@ 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.controller.VitroRequest" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %>
@ -25,7 +25,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
%> %>
<% <%
if (!LoginFormBean.loggedIn(request, LoginFormBean.CURATOR)) {%> if (!LoginStatusBean.getBean(request).isLoggedInAtLeast(LoginStatusBean.CURATOR)) {%>
<c:redirect url="<%= Controllers.LOGIN %>" /> <c:redirect url="<%= Controllers.LOGIN %>" />
<% <%
} }

View file

@ -31,9 +31,9 @@
<%@ page import="org.apache.commons.logging.Log" %> <%@ page import="org.apache.commons.logging.Log" %>
<%@ page import="org.apache.commons.logging.LogFactory" %> <%@ page import="org.apache.commons.logging.LogFactory" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %> <%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
<%@page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils"%><jsp:useBean id="loginHandler" class="edu.cornell.mannlib.vedit.beans.LoginFormBean" scope="session" /> <%@page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils"%>
<%! <%!
public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.templates.entity.entityMergedPropsList.jsp"); public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.templates.entity.entityMergedPropsList.jsp");
%> %>
@ -41,7 +41,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
log.debug("setting showSelfEdits true");%> log.debug("setting showSelfEdits true");%>
<c:set var="showSelfEdits" value="${true}"/> <c:set var="showSelfEdits" value="${true}"/>
<% } <% }
if (loginHandler!=null && loginHandler.getLoginStatus()=="authenticated" && Integer.parseInt(loginHandler.getLoginRole())>=loginHandler.getNonEditor()) { if (LoginStatusBean.getBean(request).isLoggedIn()) {
log.debug("setting showCuratorEdits true");%> log.debug("setting showCuratorEdits true");%>
<c:set var="showCuratorEdits" value="${true}"/> <c:set var="showCuratorEdits" value="${true}"/>
<c:set var='themeDir'><c:out value='${portalBean.themeDir}' /></c:set> <c:set var='themeDir'><c:out value='${portalBean.themeDir}' /></c:set>

View file

@ -25,7 +25,7 @@
<%@ page import="edu.cornell.mannlib.vitro.webapp.dao.VClassDao" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.dao.VClassDao" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.beans.VClass" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.beans.VClass" %>
<%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep" %>
<%@ page import="edu.cornell.mannlib.vedit.beans.LoginFormBean" %> <%@ page import="edu.cornell.mannlib.vedit.beans.LoginStatusBean" %>
<%@page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils"%> <%@page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils"%>
<%@ page import="java.util.Collection" %> <%@ page import="java.util.Collection" %>
@ -41,8 +41,6 @@
<%@ page import="org.apache.commons.logging.Log" %> <%@ page import="org.apache.commons.logging.Log" %>
<%@ page import="org.apache.commons.logging.LogFactory" %> <%@ page import="org.apache.commons.logging.LogFactory" %>
<jsp:useBean id="loginHandler" class="edu.cornell.mannlib.vedit.beans.LoginFormBean" scope="session" />
<%! <%!
public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.templates.entity.entityMergedPropsList.jsp"); public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.templates.entity.entityMergedPropsList.jsp");
%> %>
@ -51,7 +49,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
log.debug("setting showSelfEdits true");%> log.debug("setting showSelfEdits true");%>
<c:set var="showSelfEdits" value="${true}"/> <c:set var="showSelfEdits" value="${true}"/>
<% } <% }
if (loginHandler!=null && loginHandler.getLoginStatus()=="authenticated" && Integer.parseInt(loginHandler.getLoginRole())>=loginHandler.getNonEditor()) { if (LoginStatusBean.getBean(request).isLoggedIn()) {
log.debug("setting showCuratorEdits true");%> log.debug("setting showCuratorEdits true");%>
<c:set var="showCuratorEdits" value="${true}"/> <c:set var="showCuratorEdits" value="${true}"/>
<% }%> <% }%>