Index: lib/style/skins/sanparks/searchWorkflowRun.jsp
===================================================================
--- lib/style/skins/sanparks/searchWorkflowRun.jsp	(revision 5081)
+++ lib/style/skins/sanparks/searchWorkflowRun.jsp	(revision 5082)
@@ -40,7 +40,7 @@
 		<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/widgets/form-fields-widget.js"></script>
 		<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/prototype-1.5.1.1/prototype.js"></script>
 		<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/ajax-utils.js"></script>
-		<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/searchWorkflowRun.js"></script></script>
+		<script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/searchWorkflowRun.js"></script>
     </head>
     <body class="main-section" onload="setWorkflowQueryFormField('tpcSearch');submitFormIntoDiv('<%=SERVLET_URL%>','tpcSearch','workflow-search-results')">
         <jsp:include page="header2.jsp"/>
Index: lib/style/skins/sanparks/sanparks-scheduled-jobs.css
===================================================================
--- lib/style/skins/sanparks/sanparks-scheduled-jobs.css	(revision 5081)
+++ lib/style/skins/sanparks/sanparks-scheduled-jobs.css	(revision 5082)
@@ -47,12 +47,6 @@
 	margin:0px 60px 20px 178px;
 }
 
-.content-subsection {
-	vertical-align: middle;
-	margin: 0px 0px 0px 195px;
-	width: 820px;
-}
-
 .content-subsection-header {
 	margin: 10px 0px 5px 0px;
 	padding: 0px 0px 0px 0px;
Index: lib/style/skins/sanparks/changeAccess.jsp
===================================================================
--- lib/style/skins/sanparks/changeAccess.jsp	(nonexistent)
+++ lib/style/skins/sanparks/changeAccess.jsp	(revision 5082)
@@ -0,0 +1,68 @@
+<%@ page language="java" %>
+
+<%
+/*
+*  '$RCSfile$'
+*    Copyright: 2009 Regents of the University of California and the
+*               National Center for Ecological Analysis and Synthesis
+*
+*   '$Author: daigle $'
+*     '$Date: 2008-07-06 21:25:34 -0700 (Sun, 06 Jul 2008) $'
+* '$Revision: 4080 $'
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+%>
+<%@ include file="settings.jsp"%>
+
+<html>
+    <head>
+        <title>Sanparks TPC Report Search</title>
+        <link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/sanparks.css"/>
+		<link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/sanparks-scheduled-jobs.css"/>
+        <link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/header2.css"/>
+        <link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/left-nav2.css"/>
+        <link rel="stylesheet" type="text/css" href="<%=STYLE_SKINS_URL%>/sanparks/footer2.css"/>
+        <script language="JavaScript" type="text/JavaScript" src="<%=STYLE_SKINS_URL%>/sanparks/sanparks.js"></script>
+        <script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/branding.js"></script>
+        <script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/prototype-1.5.1.1/prototype.js"></script>
+        <script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/ajax-utils.js"></script>
+        <script language="JavaScript" type="text/JavaScript" src="<%=STYLE_COMMON_URL%>/access.js"></script>
+    </head>
+    <body class="main-section" onload="getAccessSection('<%=SERVLET_URL%>','<%=request.getParameter("workflowid")%>','<%=request.getParameter("workflowname")%>','sanparks','access-info-content')">
+        <jsp:include page="header2.jsp"/>
+        
+        <!-- Main content -->
+        <jsp:include page="left-nav2.jsp"/>
+		<div class="content-section">
+			<div class="content-subsection" id="access-info-section"> 
+				<div class="content-subsection-header-emphasis">Workflow Summary</div> 
+    			<div class="form-input-row" id="form-base-row">
+	    			<div class="summary-field" id='workflow-name-label' >Name: </div>  
+					<div class="summary-value" id='workflow-name-value' ><%=request.getParameter("workflowname")%></div>	  
+					<br/>
+					<div class="summary-field" id='workflow-lsid-label' >LSID: </div>  
+					<div class="summary-value" id='workflow-lsid-value' ><%=request.getParameter("workflowid")%></div>						
+	  			</div>
+			</div>
+
+			<div class="access-info-content" id="access-info-content"></div>
+		</div>
+        
+        <!-- Footer Content -->
+        <jsp:include page="footer2.jsp" />
+    </body>
+</html>
Index: lib/style/skins/sanparks/sanparks.css
===================================================================
--- lib/style/skins/sanparks/sanparks.css	(revision 5081)
+++ lib/style/skins/sanparks/sanparks.css	(revision 5082)
@@ -35,7 +35,7 @@
 
 @import url(../../../style/common/eml_xsl.css);
 b {
-font-weight: bold;
+	font-weight: bold;
 }
 
 /**
@@ -735,8 +735,9 @@
 }
 
 .content-subsection {
-	margin: 0px 0px 6px 180px;
 	vertical-align: middle;
+	margin: 0px 0px 0px 195px;
+	width: 820px;
 }
 
 .content-subsection-header {
@@ -745,6 +746,12 @@
 	font-size: 16px;
 }
 
+.content-subsection-header-emphasis {
+	font-size: 16px;
+	color: #DD7744;
+	margin-bottom: 5px;
+}
+
 /********************************************************************** 
  * form field settings
  **********************************************************************/
@@ -846,3 +853,90 @@
 .col4 {	
 	width: 100px;
 }
+
+/********************************************************************** 
+ * change access specific settings
+ **********************************************************************/
+
+.change-access-header {
+	color: #255333;
+	font-size: 16px;
+	font-style: normal;
+	font-weight: bold;
+	margin-left: 10px;
+}
+
+.change-access-header-emphasis {
+	color: #DD7744; 
+	font-size: 16px;
+	display: inline;
+	float: left;
+	margin-left: 10px;
+}
+
+.change-access-header-workflow {
+	font-size: 16px;
+	margin-left:10px;
+	display: inline;
+	float: left;
+}
+
+.change-access-indent-emphasis {
+	color: #DD7744; 
+	font-size: 16px;
+	font-weight: normal;
+	display: inline;
+	float: left;
+	margin-left: 30px;
+}
+
+.change-access-row {
+	display: block;
+	margin-bottom: 5px;
+}
+
+.col_label {
+	color: #255333;
+	font-size: 14px;
+}
+
+.access_info_text {
+	font-size: 14px;	
+}
+
+.access_order_col {
+	width: 90px;
+	margin-left: 10px;
+	display: inline;
+	float: left;
+}
+.access_type_col {
+	width: 85px;
+	margin-left: 10px;
+	display: inline;
+	float: left;
+}
+
+.principal_col {
+	width: 400px;
+	margin-left: 10px;
+	display: inline;
+	float: left;
+}
+
+.permissions_col {	
+	width: 100px;
+	margin-left: 10px;
+	display: inline;
+}
+
+.permission_element {	
+	display: inline;
+	font-size: 14px;
+}
+
+.access-submit-button {
+	margin: 20px 0px 10px 300px;
+	width: 150px;
+}
+
Index: lib/style/skins/sanparks/sanparks.xml
===================================================================
--- lib/style/skins/sanparks/sanparks.xml	(revision 5081)
+++ lib/style/skins/sanparks/sanparks.xml	(revision 5082)
@@ -24,6 +24,12 @@
   <doctype publicid="-//NCEAS//unauth_login//EN">
     <target publicid="-//W3C//HTML//EN">/style/skins/sanparks/knp-login.xsl</target>
   </doctype>
+  <doctype publicid="-//NCEAS//getaccesscontrol//EN">
+    <target publicid="-//W3C//HTML//EN">/style/common/accessInfo.xsl</target>
+  </doctype>
+  <doctype publicid="-//NCEAS//getaccesscontrol//EN">
+    <target publicid="-//W3C//HTML//EN">/style/common/accessInfo.xsl</target>
+  </doctype>
 
 <!--
     ARE THESE STILL NEEDED????????????
Index: lib/style/skins/sanparks/scheduleWorkflowRun.jsp
===================================================================
--- lib/style/skins/sanparks/scheduleWorkflowRun.jsp	(revision 5081)
+++ lib/style/skins/sanparks/scheduleWorkflowRun.jsp	(revision 5082)
@@ -66,9 +66,9 @@
 %>
 				<div class="warning-header">You have view permissions only for this workflow</div>
 <%
-    	    }
-%>
-				<div class="result-header-emphasis">Workflow Summary</div> 
+    	    } 
+%>		
+				<div class="content-subsection-header-emphasis">Workflow Summary</div> 
     			<div class="form-input-row" id="form-base-row">
     				<div class="summary-field" id='workflow-name-label' >Name: </div>  
 <%
@@ -84,6 +84,8 @@
 					if (request.getParameter("workflowid") != null) {
 %>
 						<div class="summary-value" id='workflow-lsid-value' ><%=request.getParameter("workflowid")%></div>
+						(<jsp:text><![CDATA[<a href=./changeAccess.jsp?workflowid=]]></jsp:text><jsp:expression>request.getParameter("workflowid")</jsp:expression><jsp:text><![CDATA[&workflowname=]]></jsp:text><jsp:expression>request.getParameter("workflowname")</jsp:expression><jsp:text><![CDATA[>Change Access Permissions</a>]]></jsp:text>)
+						
 <%
 					}
 %>	  
Index: lib/style/common/access.js
===================================================================
--- lib/style/common/access.js	(nonexistent)
+++ lib/style/common/access.js	(revision 5082)
@@ -0,0 +1,85 @@
+ /*
+  *   '$RCSfile$'
+  *     Purpose: Basic funtions to support showing the schedule workflows 
+  *              pages
+  *   Copyright: 2009 Regents of the University of California and the
+  *               National Center for Ecological Analysis and Synthesis
+  *     Authors: Michael Daigle
+  *
+  *    '$Author: leinfelder $'
+  *      '$Date: 2008-06-17 13:16:32 -0700 (Tue, 17 Jun 2008) $'
+  *  '$Revision: 4006 $'
+  *
+  * This program is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License as published by
+  * the Free Software Foundation; either version 2 of the License, or
+  * (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU General Public License for more details.
+  *
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software
+  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  */ 
+  
+/* puts together the url to get the workflow section of a page given the workflow 
+ * id.  
+ *  Params:
+ *    url - metacat url to hit
+ *    workflowId - get all runs for this id 
+ *    workflowName - used for display purposes.  
+ *    divId - the name of the div where the results should be put
+ */  
+function getAccessSection(url, workflowId, workflowname, qformat, divId) {
+	var requestUrl = url + '?action=getaccesscontrol&docid=' + workflowId + 
+		"&workflowname=" + workflowname + '&qformat=' + qformat;
+	//alert('getAccessSection - url: ' + requestUrl);
+	var submitResults = submitUrlIntoDiv(requestUrl, divId);
+}
+
+function setPermission(formObj) {
+	
+	//alert("principal: " + formObj.principal.value);		
+	if ( formObj.principal.value == null || formObj.principal.value == "") {
+		alert("you must provide a pricipal");
+		return;
+	}
+
+	var permission = "";
+	if (formObj.permission_read_checkbox.checked) {
+		permission += "READ";
+	}
+	if (formObj.permission_write_checkbox.checked) {
+		if (permission.length > 0) {
+			permission += "|";
+		}
+		permission += "WRITE";
+	}
+	if (formObj.permission_chmod_checkbox.checked) {
+		if (permission.length > 0) {
+			permission += "|";
+		}
+		permission |= CHMOD;
+	}
+	if (formObj.permission_all_checkbox.checked) {
+		if (permission.length > 0) {
+			permission += "|";
+		}
+		permission |= "ALL";
+	}
+	//alert("permission: " + permission);
+	formObj.permission.value = permission;
+	
+	if (permission == "") {
+		alert("You must choose a permission value");
+		return;
+	}
+}
+
+function doNothing() {
+}
+
+	

Property changes on: lib/style/common/access.js
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: lib/style/common/accessInfo.xsl
===================================================================
--- lib/style/common/accessInfo.xsl	(nonexistent)
+++ lib/style/common/accessInfo.xsl	(revision 5082)
@@ -0,0 +1,152 @@
+<?xml version="1.0"?>
+<!--
+	*  '$RCSfile$'
+	*      Authors: Michael Daigle
+	*    Copyright: 2009 Regents of the University of California and the
+	*               National Center for Ecological Analysis and Synthesis
+	*  For Details: http://www.nceas.ucsb.edu/
+	*
+	*   '$Author: leinfelder $'
+	*     '$Date: 2009-04-02 14:20:05 -0800 (Thu, 02 Apr 2009) $'
+	* '$Revision: 4893 $'
+	*
+	* This program is free software; you can redistribute it and/or modify
+	* it under the terms of the GNU General Public License as published by
+	* the Free Software Foundation; either version 2 of the License, or
+	* (at your option) any later version.
+	*
+	* This program is distributed in the hope that it will be useful,
+	* but WITHOUT ANY WARRANTY; without even the implied warranty of
+	* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	* GNU General Public License for more details.
+	*
+	* You should have received a copy of the GNU General Public License
+	* along with this program; if not, write to the Free Software
+	* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+	*
+	* This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
+	* convert an XML file showing the resultset of a query
+	* into an HTML format suitable for rendering with modern web browsers.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+	<xsl:output method="html" />
+	<xsl:param name="sessid" />
+	<xsl:param name="qformat">default</xsl:param>
+	<xsl:param name="enableediting">false</xsl:param>
+	<xsl:param name="contextURL" />
+	<xsl:param name="servletURL" />
+	<xsl:param name="workflowname" />
+	<xsl:param name="docid" />
+	
+	<xsl:template match="/">  
+ 	
+		<div class="content-subsection">
+			<div class="content-subsection-header-emphasis">Access Rules</div>
+			<div class="change-access-row">
+				<div class="col_label access_order_col">Access Order</div>
+				<div class="col_label access_type_col">Access Type</div>
+				<div class="col_label principal_col">Principal</div>
+				<div class="col_label permissions_col">Permission</div>
+			</div>
+			<xsl:choose>
+			<xsl:when test="acl/resource/@order = 'allowFirst'">
+				<xsl:for-each select="acl/resource/allow/principal">
+					<div class="access_info_text access_order_col">allowFirst</div>
+					<div class="access_info_text access_type_col">allow </div>
+					<div class="access_info_text principal_col">
+						<xsl:value-of select="."/>
+					</div>	
+					<div class="permissions_col">
+						<xsl:for-each select="../permission">
+							<div class="permission_element"><xsl:value-of select="."/></div>
+						</xsl:for-each>
+					</div><br/>
+				</xsl:for-each>			
+				<xsl:for-each select="acl/resource/deny/principal">
+					<div class="access_info_text access_order_col">allowFirst</div>
+					<div class="access_info_text access_type_col">deny </div>
+					<div class="access_info_text principal_col">
+						<xsl:value-of select="."/>
+					</div>	
+					<div class="permissions_col">
+						<xsl:for-each select="../permission">
+							<div class="permission_element"><xsl:value-of select="."/></div>
+						</xsl:for-each>
+					</div>	
+				</xsl:for-each>
+			</xsl:when>
+	
+			<xsl:when test="count(acl/resource/@order[denyFirst]) &gt; 0">
+				<xsl:for-each select="acl/resource/allow/principal">
+					<div class="access_info_text access_order_col">denyFirst</div>
+					<div class="access_info_text access_type_col">allow </div>
+					<div class="access_info_text principal_col">
+						<xsl:value-of select="."/>
+					</div>	
+					<div class="permissions_col">
+						<xsl:for-each select="../permission">
+							<div class="permission_element"><xsl:value-of select="."/></div>
+						</xsl:for-each>
+					</div>
+				</xsl:for-each>			
+				<xsl:for-each select="acl/resource/deny/principal">
+					<div class="access_info_text access_order_col">denyFirst</div>
+					<div class="access_info_text access_type_col">deny </div>
+					<div class="access_info_text principal_col">
+						<xsl:value-of select="."/>
+					</div>	
+					<div class="permissions_col">
+						<xsl:for-each select="../permission">
+							<div class="permission_element"><xsl:value-of select="."/></div>
+						</xsl:for-each>
+					</div>	
+				</xsl:for-each>
+			</xsl:when>
+			</xsl:choose>	
+		</div><br/>
+		<div class="content-subsection">
+			<div class="content-subsection-header-emphasis">Add Access Rule</div>
+			<div class="change-access-row">
+				<div class="col_label access_order_col">Access Order</div>
+				<div class="col_label access_type_col">Access Type</div>
+				<div class="col_label principal_col">Principal</div>
+				<div class="col_label permissions_col">Permission</div>
+			</div>
+						
+			<div class="change-access-row">
+				<form name="addAccess" action="{$servletURL}" id="addAccess" onsubmit="setPermission(this)">
+					<input name="action" value="setaccess" type="hidden" />  
+					<input name="qformat" value="sanparks" type="hidden" />
+					<input name="forwardto" value="changeAccess.jsp" type="hidden" />
+					<input name="permission" id="permission" type="hidden" />
+					<input name="docid" value="{$docid}" type="hidden" />
+					<input name="workflowid" value="{$docid}" type="hidden" />
+					<input name="workflowname" value="{$workflowname}" type="hidden" />
+
+					<select class="access_order_col" name="permOrder" id="permOrder">
+						<option value="allowFirst">Allow First</option>
+						<option value="denyFirst">Deny First</option>
+					</select>   
+					<select class="access_type_col" name="permType" id="permType">
+						<option value="allow">Allow</option>
+						<option value="deny">Deny</option>
+					</select>   
+					<input class="principal_col" name="principal" id="principal" type="text" /> 
+       				<div class="permissions_col">
+       					<input type="checkbox" name="permission_read_checkbox" id="permission_read_checkbox">Read</input>
+       					<input type="checkbox" name="permission_write_checkbox" id="permission_write_checkbox">Write</input>
+       					<input type="checkbox" name="permission_chmod_checkbox" id="permission_chmod_checkbox">Chmod</input>
+       					<input type="checkbox" name="permission_all_checkbox" id="permission_all_checkbox">All</input>
+       				</div>
+       		
+       				<br/>
+       				<input class="access-submit-button" value="Add" type="submit"/>
+
+				</form>
+			</div>
+		</div>
+		
+	</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

Property changes on: lib/style/common/accessInfo.xsl
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/edu/ucsb/nceas/metacat/MetaCatServlet.java
===================================================================
--- src/edu/ucsb/nceas/metacat/MetaCatServlet.java	(revision 5081)
+++ src/edu/ucsb/nceas/metacat/MetaCatServlet.java	(revision 5082)
@@ -105,6 +105,7 @@
 import edu.ucsb.nceas.utilities.FileUtil;
 import edu.ucsb.nceas.utilities.GeneralPropertyException;
 import edu.ucsb.nceas.utilities.LSIDUtil;
+import edu.ucsb.nceas.utilities.ParseLSIDException;
 import edu.ucsb.nceas.utilities.PropertyNotFoundException;
 import edu.ucsb.nceas.utilities.UtilException;
 
@@ -932,7 +933,7 @@
 				out.close();
 			} else if (action.equals("setaccess")) {
 				PrintWriter out = response.getWriter();
-				handleSetAccessAction(out, params, userName);
+				handleSetAccessAction(out, params, userName, request, response);
 				out.close();
 			} else if (action.equals("getaccesscontrol")) {
 				PrintWriter out = response.getWriter();
@@ -2697,10 +2698,26 @@
     private void handleGetAccessControlAction(PrintWriter out,
             Hashtable<String,String[]> params, HttpServletResponse response, String username,
             String[] groupnames) {
+    	
+    	Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
         DBConnection dbConn = null;
         int serialNumber = -1;
         String docid = params.get("docid")[0];
+        if (docid.startsWith("urn:")) {
+        	try {
+        		String actualDocId = LSIDUtil.getDocId(docid, false);
+        		docid = actualDocId;
+        	} catch (ParseLSIDException ple) {
+        		logMetacat.error("MetaCatServlet.handleGetAccessControlAction - " +
+        				"could not parse lsid: " + docid + " : " + ple.getMessage());        		
+        	}
+        }
         
+        String qformat = "xml";
+        if (params.get("qformat") != null) {
+            qformat = (params.get("qformat"))[0];
+        }
+        
         try {
             
             // get connection from the pool
@@ -2709,8 +2726,15 @@
             serialNumber = dbConn.getCheckOutSerialNumber();
             AccessControlList aclobj = new AccessControlList(dbConn);
             String acltext = aclobj.getACL(docid, username, groupnames);
-            out.println(acltext);
-            
+            if (qformat.equals("xml")) {
+                response.setContentType("text/xml");
+            	out.println(acltext);
+            } else {
+            	DBTransform trans = new DBTransform();
+            	response.setContentType("text/html");
+            	trans.transformXMLDocument(acltext,"-//NCEAS//getaccesscontrol//EN", 
+            		"-//W3C//HTML//EN", qformat, out, params, null);              
+            }            
         } catch (Exception e) {
             out.println("<?xml version=\"1.0\"?>");
             out.println("<error>");
@@ -3479,7 +3503,7 @@
      * A method to handle set access action
      */
     private void handleSetAccessAction(PrintWriter out, Hashtable<String, String[]> params,
-            String username) {
+            String username, HttpServletRequest request, HttpServletResponse response) {
         Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
         String[] docList = null;
         String[] principalList = null;
@@ -3486,6 +3510,7 @@
         String[] permissionList = null;
         String[] permTypeList = null;
         String[] permOrderList = null;
+        String[] qformatList = null;
         String permission = null;
         String permType = null;
         String permOrder = null;
@@ -3515,6 +3540,11 @@
             
         }
         
+        if (params.containsKey("qformat")) {
+            qformatList = params.get("qformat");
+            
+        }
+        
         // Make sure the parameter is not null
         if (docList == null || principalList == null || permTypeList == null
                 || permissionList == null) {
@@ -3552,7 +3582,18 @@
         
         // handle every accessionNumber
         for (int i = 0; i < docList.length; i++) {
-            String accessionNumber = docList[i];
+        	String docid = docList[i];
+            if (docid.startsWith("urn:")) {
+            	try {
+            		String actualDocId = LSIDUtil.getDocId(docid, false);
+            		docid = actualDocId;
+            	} catch (ParseLSIDException ple) {
+            		logMetacat.error("MetaCatServlet.handleGetAccessControlAction - " +
+            				"could not parse lsid: " + docid + " : " + ple.getMessage());        		
+            	}
+            }
+        	
+            String accessionNumber = docid;
             String owner = null;
             String publicId = null;
             // Get document owner and public id
@@ -3635,7 +3676,17 @@
             logMetacat.debug("ForceReplicationHandler created: " + frh.toString());
             
         }
-        outputResponse(successList, errorList, out);
+        if (params.get("forwardto")  != null) {
+        	try {
+        		RequestUtil.forwardRequest(request, response, params);
+        	} catch (MetacatUtilException mue) {
+        		logMetacat.error("metaCatServlet.handleSetAccessAction - could not forward " +
+        				"request. Sending output to response writer");
+        		outputResponse(successList, errorList, out);
+        	}       		
+        } else {
+        	outputResponse(successList, errorList, out);
+        }
     }
     
     /*
Index: src/edu/ucsb/nceas/metacat/AccessControlList.java
===================================================================
--- src/edu/ucsb/nceas/metacat/AccessControlList.java	(revision 5081)
+++ src/edu/ucsb/nceas/metacat/AccessControlList.java	(revision 5082)
@@ -31,9 +31,6 @@
 import java.sql.*;
 import java.util.Stack;
 import java.util.Vector;
-import java.util.Hashtable;
-import java.net.URL;
-import java.net.MalformedURLException;
 
 import org.apache.log4j.Logger;
 import org.xml.sax.Attributes;
@@ -42,7 +39,6 @@
 import org.xml.sax.EntityResolver;
 import org.xml.sax.ErrorHandler;
 import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.XMLReaderFactory;
 import org.xml.sax.helpers.DefaultHandler;
@@ -49,7 +45,6 @@
 
 import edu.ucsb.nceas.metacat.database.DBConnection;
 import edu.ucsb.nceas.metacat.database.DBConnectionPool;
-import edu.ucsb.nceas.metacat.database.DatabaseService;
 import edu.ucsb.nceas.metacat.properties.PropertyService;
 import edu.ucsb.nceas.metacat.util.MetacatUtil;
 import edu.ucsb.nceas.metacat.util.SystemUtil;
@@ -836,13 +831,13 @@
              endTime != null && !endTime.equals(end_prev)  ||
              beginTime != null && !beginTime.equals(begin_prev) ||
              ticketCount != ticket_prev )  {
-          if ( (permission & READ) != 0 ) {
+          if ( (permission & READ) == READ ) {
             outTemp.append("      <permission>read</permission>\n");
           }
-          if ( (permission & WRITE) != 0 ) {
+          if ( (permission & WRITE) == WRITE ) {
             outTemp.append("      <permission>write</permission>\n");
           }
-          if ( (permission & ALL) != 0 ) {
+          if ( (permission & ALL) == ALL ) {
             outTemp.append("      <permission>all</permission>\n");
           }
           if ( (beginTime != null) || (endTime != null) ) {
