Index: src/edu/ucsb/nceas/metacat/dataone/CrudService.java
===================================================================
--- src/edu/ucsb/nceas/metacat/dataone/CrudService.java	(revision 5443)
+++ src/edu/ucsb/nceas/metacat/dataone/CrudService.java	(revision 5444)
@@ -268,6 +268,7 @@
             InputStream object, SystemMetadata sysmeta) throws InvalidToken, 
             ServiceFailure, NotAuthorized, IdentifierNotUnique, UnsupportedType, 
             InsufficientResources, InvalidSystemMetadata, NotImplemented {
+        System.out.println("#####################Create!");
 
         logMetacat.debug("Starting CrudService.create()...");
         
@@ -332,9 +333,11 @@
         // For Metadata and Data, insert the system metadata into the object store too
         String sysMetaLocalId = insertSystemMetadata(sysmeta, sessionData);
         //get the document info.  add any access params for the sysmeta too
+        System.out.println("looking for access records to add for system " +
+            "metadata who's parent doc's  local id is " + localId);
         try
         {
-            Hashtable<String, Object> h = im.getDocumentInfo(sysMetaLocalId);
+            Hashtable<String, Object> h = im.getDocumentInfo(localId.substring(0, localId.lastIndexOf(".")));
             Vector v = (Vector)h.get("access");
             for(int i=0; i<v.size(); i++)
             {
@@ -344,7 +347,10 @@
                 String permissionType = (String)ah.get("permission_type");
                 String permissionOrder = (String)ah.get("permission_order");
                 int perm = new Integer(permission).intValue();
-                this.setAccess(token, guid, principal, perm, permissionType, permissionOrder, false);
+                System.out.println("found access record for principal " + principal);
+                System.out.println("permission: " + perm + " perm_type: " + permissionType + 
+                    " perm_order: " + permissionOrder);
+                this.setAccess(token, guid, principal, perm, permissionType, permissionOrder, true);
             }
         }
         catch(Exception e)
@@ -437,6 +443,8 @@
         {
             perm = "write";
         }
+        System.out.println("perm in setAccess: " + perm);
+        System.out.println("permission in setAccess: " + permission);
         setAccess(token, id, principal, perm, permissionType, permissionOrder,
                 setSystemMetadata);
        
@@ -1386,7 +1394,7 @@
         System.out.println("****inserting new system metadata with modified date " + sysmeta.getDateSysMetadataModified());
 
         String xml = new String(serializeSystemMetadata(sysmeta).toByteArray());
-        //System.out.println("sysmeta: " + xml);
+        System.out.println("sysmeta: " + xml);
         String localId = insertDocument(xml, sysMetaGuid, sessionData);
         System.out.println("sysmeta inserted with localId " + localId);
         //insert the system metadata doc id into the identifiers table to 
Index: src/edu/ucsb/nceas/metacat/IdentifierManager.java
===================================================================
--- src/edu/ucsb/nceas/metacat/IdentifierManager.java	(revision 5443)
+++ src/edu/ucsb/nceas/metacat/IdentifierManager.java	(revision 5444)
@@ -133,8 +133,9 @@
                 throw new McdbDocNotFoundException("Could not find document " + localId);
             }
             
-            String sql2 = "select principal_name, permission, perm_type, perm_order from xml_acccess " +
+            String sql2 = "select principal_name, permission, perm_type, perm_order from xml_access " +
             "where docid like '" + localId + "'";
+            System.out.println("executing sql: " + sql2);
             PreparedStatement stmt2 = dbConn.prepareStatement(sql2);
             rs = stmt2.executeQuery();
             Vector accessVector = new Vector();
@@ -149,6 +150,7 @@
                 accessHash.put("permission", permission);
                 accessHash.put("permission_type", permissionType);
                 accessHash.put("permission_order", permissionOrder);
+                System.out.println("accessHash: " + accessHash.toString());
                 accessVector.add(accessHash);
             }
             h.put("access", accessVector);
@@ -155,6 +157,7 @@
         } 
         catch (SQLException e) 
         {
+            e.printStackTrace();
             logMetacat.error("Error while getting document info for localid " + localId + " : "  
                     + e.getMessage());
         } 
