Index: src/edu/ucsb/nceas/metacat/DBQuery.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DBQuery.java	(revision 1426)
+++ src/edu/ucsb/nceas/metacat/DBQuery.java	(revision 1427)
@@ -1000,9 +1000,9 @@
                   throws SQLException, Exception
   {
     // Check for READ permission on @docid for @user and/or @groups
-    //AccessControlList aclobj = new AccessControlList();
-    //return aclobj.hasPermission("READ", user, groups, docid);
-    return AccessControlList.hasPermission("READ", user, groups, docid);
+   PermissionController controller = new PermissionController(docid);
+   return controller.hasPermission(user,groups,
+                                 AccessControlInterface.READSTRING);
   }
 
   /**
Index: src/edu/ucsb/nceas/metacat/DocumentImpl.java
===================================================================
--- src/edu/ucsb/nceas/metacat/DocumentImpl.java	(revision 1426)
+++ src/edu/ucsb/nceas/metacat/DocumentImpl.java	(revision 1427)
@@ -855,7 +855,7 @@
         if ( currentNode.parentnodeid != currentElement.nodeid ) {
           while ( currentNode.parentnodeid != currentElement.nodeid ) {
             currentElement = (NodeRecord)openElements.pop();
-            util.debugMessage("\n POPPED: " + currentElement.nodename);
+            util.debugMessage("\n POPPED: " + currentElement.nodename, 50);
             if (previousNodeWasElement) {
               out.print(">");
               previousNodeWasElement = false;
@@ -894,7 +894,7 @@
           }
         }
         openElements.push(currentNode);
-        util.debugMessage("\n PUSHED: " + currentNode.nodename);
+        util.debugMessage("\n PUSHED: " + currentNode.nodename, 50);
         previousNodeWasElement = true;
         if ( currentNode.nodeprefix != null ) {
           out.print("<" + currentNode.nodeprefix + ":" + currentNode.nodename);
@@ -954,7 +954,7 @@
     while(!openElements.empty())
     {
       NodeRecord currentElement = (NodeRecord)openElements.pop();
-      util.debugMessage("\n POPPED: " + currentElement.nodename);
+      util.debugMessage("\n POPPED: " + currentElement.nodename, 50);
       if ( currentElement.nodeprefix != null ) {
         out.print("</" + currentElement.nodeprefix + ":" + 
                   currentElement.nodename + ">" );
@@ -1475,7 +1475,7 @@
       char istreamChar;
      
       // check for 'write' permission for 'user' to update this document
-      if ( !hasPermission(user, groups, docid) ) {
+      if ( !hasWritePermission(user, groups, docid) ) {
         throw new Exception("User " + user + 
               " does not have permission to update XML Document #" + accnum);
       }        
@@ -1550,7 +1550,7 @@
     if ( action.equals("UPDATE") ) {
       // check for 'write' permission for 'user' to update this document
 
-      if ( !hasPermission(user, groups, docid) ) {
+      if ( !hasWritePermission(user, groups, docid) ) {
         throw new Exception("User " + user + 
               " does not have permission to update XML Document #" + accnum);
       }          
@@ -1735,7 +1735,7 @@
     
 
     // check for 'write' permission for 'user' to delete this document
-      if ( !hasPermission(user, groups, docid) ) {
+      if ( !hasWritePermission(user, groups, docid) ) {
         throw new Exception("User " + user + 
               " does not have permission to delete XML Document #" + accnum);
       }
@@ -1805,14 +1805,14 @@
     * Check for "WRITE" permission on @docid for @user and/or @groups 
     * from DB connection 
     */
-  private static boolean hasPermission (String user,
+  private static boolean hasWritePermission (String user,
                                   String[] groups, String docid ) 
                   throws SQLException, Exception
   {
     // Check for WRITE permission on @docid for @user and/or @groups
-    //AccessControlList aclobj = new AccessControlList(dbconn);
-    return AccessControlList.hasPermission("WRITE", user, groups, docid);
-    //return aclobj.hasPermission("WRITE", user, groups, docid);
+    PermissionController controller = new PermissionController(docid);
+    return controller.hasPermission(user,groups,
+                                    AccessControlInterface.WRITESTRING);
   }
 
   /** 
@@ -1827,9 +1827,10 @@
                   throws SQLException, Exception
   {
     // Check for READ permission on @docid for @user and/or @groups
-    //AccessControlList aclObj = new AccessControlList(conn);
-    //return aclObj.hasPermission("READ", user, groups, docId);
-    return AccessControlList.hasPermission("READ", user, groups, docId);
+    PermissionController controller = 
+                        new PermissionController(docId);
+    return controller.hasPermission(user,groups,
+                                            AccessControlInterface.READSTRING);
   }  
 
   
