Project

General

Profile

1
/**
2
 *  '$RCSfile$'
3
 *  Copyright: 2004 Regents of the University of California and the
4
 *              National Center for Ecological Analysis and Synthesis
5
 *  Purpose: To test the Access Controls in metacat by JUnit
6
 *
7
 *   '$Author: daigle $'
8
 *     '$Date: 2009-08-14 14:26:08 -0700 (Fri, 14 Aug 2009) $'
9
 * '$Revision: 5027 $'
10
 *
11
 * This program is free software; you can redistribute it and/or modify
12
 * it under the terms of the GNU General Public License as published by
13
 * the Free Software Foundation; either version 2 of the License, or
14
 * (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24
 */
25

    
26
package edu.ucsb.nceas.metacattest;
27

    
28
import java.io.IOException;
29
import java.io.StringReader;
30
import java.util.Vector;
31

    
32
import junit.framework.Test;
33
import junit.framework.TestSuite;
34

    
35
import edu.ucsb.nceas.MCTestCase;
36
import edu.ucsb.nceas.metacat.DocInfoHandler;
37
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlException;
38
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlInterface;
39
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlList;
40
import edu.ucsb.nceas.metacat.accesscontrol.XMLAccessDAO;
41
import edu.ucsb.nceas.metacat.client.InsufficientKarmaException;
42
import edu.ucsb.nceas.metacat.client.MetacatAuthException;
43
import edu.ucsb.nceas.metacat.client.MetacatException;
44
import edu.ucsb.nceas.metacat.client.MetacatInaccessibleException;
45
import edu.ucsb.nceas.metacat.properties.PropertyService;
46
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
47

    
48
import org.xml.sax.ContentHandler;
49
import org.xml.sax.ErrorHandler;
50
import org.xml.sax.InputSource;
51
import org.xml.sax.SAXException;
52
import org.xml.sax.XMLReader;
53
import org.xml.sax.helpers.XMLReaderFactory;
54

    
55
/**
56
 * A JUnit test for testing Access Control API in Metacat.  Note that this is different
57
 * than the Access Control test.  That test is more concerned with making sure different
58
 * combinations of access rules act appropriately.  This test is more concerned with the
59
 * funtioning of the API itself.
60
 */
61
public class AccessAPITest extends MCTestCase {
62

    
63
	private String testdatadir = "test/clienttestfiles/";
64

    
65
	/**
66
	 * Constructor to build the test
67
	 * 
68
	 * @param name
69
	 *            the name of the test method
70
	 */
71
	public AccessAPITest(String name) {
72
		super(name);
73
	}
74

    
75
	/**
76
	 * Establish a testing framework by initializing appropriate objects
77
	 */
78
	public void setUp() throws Exception {
79
		metacatConnectionNeeded = true;
80
		super.setUp();
81
	}
82

    
83
	/**
84
	 * Release any objects after tests are complete
85
	 */
86
	public void tearDown() {
87
	}
88

    
89
	/**
90
	 * Create a suite of tests to be run together
91
	 */
92
	public static Test suite() {
93
		TestSuite suite = new TestSuite();
94
		suite.addTest(new AccessAPITest("initialize"));
95
		// Test basic functions
96
		suite.addTest(new AccessAPITest("testSetSingleAccess"));
97
		suite.addTest(new AccessAPITest("testSetBlockAccess"));
98

    
99
		return suite;
100
	}
101

    
102
	/**
103
	 * Run an initial test that always passes to check that the test harness is
104
	 * working.
105
	 */
106
	public void initialize() {
107
		assertTrue(1 == 1);
108
	}
109

    
110
	/**
111
	 * Test adding access records for single principals.
112
	 */
113
	public void testSetSingleAccess() {
114
		String principal = null;
115
		Vector<XMLAccessDAO> accessDAOList = null;
116
		Vector<XMLAccessDAO> realAccessDAOList = null;
117
		XMLAccessDAO accessDAO = null;
118
		String accessXML = null;
119
	
120
		try {
121
			debug("AccessAPITest.testSetSingleAccess Running");
122
			
123
			m.login(username, password);
124

    
125
			// insert a document for us to test with
126
			String docId = generateDocumentId() + ".1";
127
			String testDoc = getTestDocFromFile(testdatadir + "accessBlockTestFile1.xml");
128
			// debug("test doc: " + testDoc);
129
			insertDocumentId(docId, testDoc, SUCCESS, false);
130
					
131
			// test inserting a single access record with allowFirst permission order and allow read 
132
			// access.  We expect this to succeed.
133
			debug("AccessAPITest.testSetSingleAccess - Test 1, add user allowFirst allow read access");
134
			principal = "uid=test30,o=NCEAS,dc=ecoinformatics,dc=org";
135
			setSingleAccess(docId, principal, 
136
					Integer.toString(AccessControlInterface.READ), 
137
					AccessControlInterface.ALLOW, 
138
					AccessControlInterface.ALLOWFIRST,
139
					true);
140
			accessDAOList = new Vector<XMLAccessDAO>();
141
			accessDAO = new XMLAccessDAO();
142
			accessDAO.setDocId(docId);
143
			accessDAO.setPrincipalName(principal);
144
			accessDAO.setPermission(new Long(AccessControlInterface.READ));
145
			accessDAO.setPermType(AccessControlInterface.ALLOW);
146
			accessDAO.setPermOrder(AccessControlInterface.ALLOWFIRST);
147
			accessDAOList.add(accessDAO);
148
			
149
			// get the access control for this doc id from metacat and make sure this
150
			// access record is in that list.
151
			accessXML = m.getAccessControl(docId);
152
			realAccessDAOList = getAccessDAOList(docId, accessXML);						
153
			compareAccessDAOs(realAccessDAOList, accessDAOList, false);	
154
			
155
			// test inserting a single access record with denyFirst permission order and allow read 
156
			// access.  We expect this to fail since a single doc cannot have multiple permission orders.
157
			debug("AccessAPITest.testSetSingleAccess - Test 2, add user denyFirst allow read/write access");
158
			principal = "uid=test31,o=NCEAS,dc=ecoinformatics,dc=org";
159
			setSingleAccess(docId, principal, 
160
					Integer.toString(AccessControlInterface.READ | AccessControlInterface.WRITE), 
161
					AccessControlInterface.ALLOW, 
162
					AccessControlInterface.DENYFIRST,
163
					false);
164

    
165

    
166
		} catch (AccessControlException ace) {
167
			fail("AccessAPITest.testSetSingleAccess - Access Control error: " + ace.getMessage());
168
		} catch (IOException ioe) {
169
			fail("AccessAPITest.testSetSingleAccess - I/O error: " + ioe.getMessage());
170
		} catch (MetacatAuthException mae) {
171
			fail("AccessAPITest.testSetSingleAccess - Metacat authentication error: " + mae.getMessage()); 
172
		} catch (MetacatException me) {
173
			fail("AccessAPITest.testSetSingleAccess - Metacat error: " + me.getMessage()); 
174
		} catch (InsufficientKarmaException ike) {
175
			fail("AccessAPITest.testSetSingleAccess - Insufficient karma error: " + ike.getMessage()); 
176
		} catch (MetacatInaccessibleException mie) {
177
			fail("AccessAPITest.testSetSingleAccess - Metacat Inaccessible Error: " + mie.getMessage());
178
		} 
179
	}
180
	
181
	/**
182
	 * Test setting a block of access for a document.  Each call should replace the access for that
183
	 * document.
184
	 */
185
	public void testSetBlockAccess() {
186
		String accessBlockXML = null;
187
		String accessXML = null;
188
		Vector<XMLAccessDAO> realAccessDAOList = null;
189
		Vector<XMLAccessDAO> accessBlockDAOList = null;
190
		
191
		try {
192
			debug("AccessAPITest.testSetBlockAccess - Running");
193
					
194
			// log in
195
			m.login(username, password);
196

    
197
			// insert a document for us to test with
198
			String docId = generateDocumentId() + ".1";
199
			String testDoc = getTestDocFromFile(testdatadir + "accessBlockTestFile1.xml");
200
			// debug("test doc: " + testDoc);
201
			insertDocumentId(docId, testDoc, SUCCESS, false);
202
			
203
			// replace access for doc using the access section in accessBlock1.xml, 
204
			// then test that the access was updated and that is the only access
205
			// for the doc
206
			debug("AccessAPITest.testSetBlockAccess - Test 1 using accessBlock1.xml");			
207
			accessBlockXML = getTestDocFromFile(testdatadir + "accessBlock1.xml");
208
			setBlockAccess(docId, accessBlockXML, true);
209
			accessXML = m.getAccessControl(docId);
210
			realAccessDAOList = getAccessDAOList(docId, accessXML);
211
			accessBlockDAOList = getAccessDAOList(docId, accessBlockXML);
212
			debugAccessDAOList(accessBlockDAOList);
213
			compareAccessDAOs(realAccessDAOList, accessBlockDAOList, true);
214

    
215
			// replace access for doc using the access section in accessBlock2.xml, 
216
			// then test that the access was updated and that is the only access
217
			// for the doc
218
			debug("AccessAPITest.testSetBlockAccess - Test 2 using accessBlock2.xml");			
219
			accessBlockXML = getTestDocFromFile(testdatadir + "accessBlock2.xml");
220
			setBlockAccess(docId, accessBlockXML, true);
221
			accessXML = m.getAccessControl(docId);
222
			realAccessDAOList = getAccessDAOList(docId, accessXML);
223
			accessBlockDAOList = getAccessDAOList(docId, accessBlockXML);
224
			debugAccessDAOList(accessBlockDAOList);
225
			compareAccessDAOs(realAccessDAOList, accessBlockDAOList, true);
226

    
227
			// replace access for doc using the access section in accessBlock3.xml, 
228
			// then test that the access was updated and that is the only access
229
			// for the doc
230
			debug("AccessAPITest.testSetBlockAccess - Test 3 using accessBlock3.xml");			
231
			accessBlockXML = getTestDocFromFile(testdatadir + "accessBlock3.xml");
232
			setBlockAccess(docId, accessBlockXML, true);
233
			accessXML = m.getAccessControl(docId);
234
			realAccessDAOList = getAccessDAOList(docId, accessXML);
235
			accessBlockDAOList = getAccessDAOList(docId, accessBlockXML);
236
			debugAccessDAOList(accessBlockDAOList);
237
			compareAccessDAOs(realAccessDAOList, accessBlockDAOList, true);
238
			
239
			// replace access for doc using the access section in accessBlock4.xml, 
240
			// then test that the access was updated and that is the only access
241
			// for the doc
242
			debug("AccessAPITest.testSetBlockAccess - Test 4 using accessBlock4.xml");			
243
			accessBlockXML = getTestDocFromFile(testdatadir + "accessBlock4.xml");
244
			setBlockAccess(docId, accessBlockXML, true);
245
			accessXML = m.getAccessControl(docId);
246
			realAccessDAOList = getAccessDAOList(docId, accessXML);
247
			accessBlockDAOList = getAccessDAOList(docId, accessBlockXML);
248
			debugAccessDAOList(accessBlockDAOList);
249
			compareAccessDAOs(realAccessDAOList, accessBlockDAOList, true);
250
			
251
			// replace access for doc using the access section in accessBlock5.xml, 
252
			// then test that the access was updated and that is the only access
253
			// for the doc
254
			debug("AccessAPITest.testSetBlockAccess - Test 5 using accessBlock5.xml");			
255
			accessBlockXML = getTestDocFromFile(testdatadir + "accessBlock5.xml");
256
			setBlockAccess(docId, accessBlockXML, true);
257
			accessXML = m.getAccessControl(docId);
258
			realAccessDAOList = getAccessDAOList(docId, accessXML);
259
			accessBlockDAOList = getAccessDAOList(docId, accessBlockXML);
260
			debugAccessDAOList(accessBlockDAOList);
261
			compareAccessDAOs(realAccessDAOList, accessBlockDAOList, true);
262
			
263
			// replace access for doc using the access section in accessBlock6.xml, 
264
			// then test that the access was updated and that is the only access
265
			// for the doc
266
			debug("AccessAPITest.testSetBlockAccess - Test 6 using accessBlock6.xml");			
267
			accessBlockXML = getTestDocFromFile(testdatadir + "accessBlock6.xml");
268
			setBlockAccess(docId, accessBlockXML, true);
269
			accessXML = m.getAccessControl(docId);
270
			realAccessDAOList = getAccessDAOList(docId, accessXML);
271
			accessBlockDAOList = getAccessDAOList(docId, accessBlockXML);
272
			debugAccessDAOList(accessBlockDAOList);
273
			compareAccessDAOs(realAccessDAOList, accessBlockDAOList, true);
274
			
275
			// replace access for doc using the access section in accessBlock7.xml, 
276
			// then test that the access was updated and that is the only access
277
			// for the doc
278
			debug("AccessAPITest.testSetBlockAccess - Test 7 using accessBlock7.xml");			
279
			accessBlockXML = getTestDocFromFile(testdatadir + "accessBlock7.xml");
280
			setBlockAccess(docId, accessBlockXML, true);
281
			accessXML = m.getAccessControl(docId);
282
			realAccessDAOList = getAccessDAOList(docId, accessXML);
283
			accessBlockDAOList = getAccessDAOList(docId, accessBlockXML);
284
			debugAccessDAOList(accessBlockDAOList);
285
			compareAccessDAOs(realAccessDAOList, accessBlockDAOList, true);
286
			
287
			// replace access for doc using the access section in accessBlock8.xml, 
288
			// then test that the access was updated and that is the only access
289
			// for the doc
290
			debug("AccessAPITest.testSetBlockAccess - Test 8 using accessBlock8.xml");			
291
			accessBlockXML = getTestDocFromFile(testdatadir + "accessBlock8.xml");
292
			setBlockAccess(docId, accessBlockXML, true);
293
			accessXML = m.getAccessControl(docId);
294
			realAccessDAOList = getAccessDAOList(docId, accessXML);
295
			accessBlockDAOList = getAccessDAOList(docId, accessBlockXML);
296
			debugAccessDAOList(accessBlockDAOList);
297
			compareAccessDAOs(realAccessDAOList, accessBlockDAOList, true);
298
			
299
			// replace access for doc using the access section in accessBlock9.xml, 
300
			// then test that the access was updated and that is the only access
301
			// for the doc
302
			debug("AccessAPITest.testSetBlockAccess - Test 9 using accessBlock9.xml");			
303
			accessBlockXML = getTestDocFromFile(testdatadir + "accessBlock9.xml");
304
			setBlockAccess(docId, accessBlockXML, true);
305
			accessXML = m.getAccessControl(docId);
306
			realAccessDAOList = getAccessDAOList(docId, accessXML);
307
			accessBlockDAOList = getAccessDAOList(docId, accessBlockXML);
308
			debugAccessDAOList(accessBlockDAOList);
309
			compareAccessDAOs(realAccessDAOList, accessBlockDAOList, true);
310
			
311
		} catch (AccessControlException ace) {
312
			fail("AccessAPITest.testSetBlockAccess - Access Control error: " + ace.getMessage());
313
		} catch (IOException ioe) {
314
			fail("AccessAPITest.testSetBlockAccess - I/O error: " + ioe.getMessage());
315
		} catch (MetacatAuthException mae) {
316
			fail("AccessAPITest.testSetBlockAccess - Metacat authentication error: " + mae.getMessage()); 
317
		} catch (MetacatException me) {
318
			fail("AccessAPITest.testSetBlockAccess - Metacat error: " + me.getMessage()); 
319
		} catch (InsufficientKarmaException ike) {
320
			fail("AccessAPITest.testSetBlockAccess - Metacat error: " + ike.getMessage()); 
321
		} catch (MetacatInaccessibleException mie) {
322
			fail("AccessAPITest.testSetBlockAccess - Metacat Inaccessible Error: " + mie.getMessage());
323
		}
324
	}
325

    
326
	/**
327
	 * Insert a single row of access for a document.
328
	 * 
329
	 * @param docId
330
	 *            the id of the document to update
331
	 * @param principal
332
	 *            the principal credentails
333
	 * @param permission
334
	 *            the permission
335
	 * @param permType
336
	 *            the permission type
337
	 * @param permOrder
338
	 *            the permission order
339
	 * @param successExpected
340
	 *            if true, we expect the insert to succeed, otherwise, we expect
341
	 *            it to fail
342
	 * @return the metacat response xml
343
	 */
344
	private String setSingleAccess(String docId, String principal, String permission, 
345
			String permType, String permOrder, boolean successExpected) {
346
		debug("AccessAPITest.setSingleAccess - docid: " + docId + ", prinicpal: " + 
347
				principal + ", permission: " + permission + ", permType: " + permType + 
348
				", permOrder: " + permOrder + ", errorExpected: " + successExpected);
349
		String response = null;
350
		try {
351
			// set the access using metacat client
352
			response = m.setAccess(docId, principal, permission, permType, permOrder); 
353

    
354
			debug("AccessAPITest.setSingleAccess - response: " + response);
355
			
356
			if (successExpected) {
357
				assertTrue(response, (response.indexOf("<success>") != -1));
358
			} else {
359
				assertTrue(response, (response.indexOf("<success>") == -1));
360
			}			
361
		} catch (MetacatInaccessibleException mie) {
362
			fail("AccessAPITest.setSingleAccess - Metacat inaccessible: " + mie.getMessage());
363
		} catch (InsufficientKarmaException ike) {
364

    
365
		} catch (MetacatException me) {
366
			if (successExpected) {
367
				fail("AccessAPITest.setSingleAccess - Metacat error: " + me.getMessage());
368
			} else {
369
				debug("AccessAPITest.setSingleAccess - Expected Metacat error: " + me.getMessage());
370
			}
371
		} catch (Exception e) {
372
			fail("AccessAPITest.setSingleAccess - General error: " + e.getMessage());
373
		}
374

    
375
		return response;
376
	}
377
	
378
	/**
379
	 * Replace a block of access
380
	 * 
381
	 * @param docId
382
	 *            the id of the doc we want to update
383
	 * @param accessBlockXML
384
	 *            the access xml section
385
	 * @param successExpected
386
	 *            if true, we expect the insert to succeed, otherwise, we expect
387
	 *            it to fail
388
	 * @return the metacat response xml
389
	 */
390
	private String setBlockAccess(String docId, String accessBlockXML, boolean successExpected) {
391
		debug("AccessAPITest.setBlockAccess - docid: " + docId + ", accessBlockXML: " + 
392
				accessBlockXML + ", errorExpected: " + successExpected);
393
		String response = null;
394
		try {
395
			// set the access using metacat client
396
			response = m.setAccess(docId, accessBlockXML); 
397

    
398
			debug("AccessAPITest.setBlockAccess - response: " + response);
399
			
400
			if (successExpected) {
401
				assertTrue(response, (response.indexOf("<success>") != -1));
402
			} else {
403
				assertTrue(response, (response.indexOf("<success>") == -1));
404
			}			
405
		} catch (MetacatInaccessibleException mie) {
406
			fail("AccessAPITest.setBlockAccess - Metacat inaccessible: " + mie.getMessage());
407
		} catch (InsufficientKarmaException ike) {
408

    
409
		} catch (MetacatException me) {
410
			if (successExpected) {
411
				fail("AccessAPITest.setBlockAccess - Metacat error: " + me.getMessage());
412
			} else {
413
				debug("AccessAPITest.setBlockAccess - Expected Metacat error: " + me.getMessage());
414
			}
415
		} catch (Exception e) {
416
			fail("AccessAPITest.setBlockAccess - General error: " + e.getMessage());
417
		}
418

    
419
		return response;
420
	}
421
	
422
	/**
423
	 * Compare two lists of XML Access DAO objects. The first list is the master
424
	 * list and the second is the sub list. All elements of the sub list must be
425
	 * in the master list or a failed assertion is generated. If the exactMatch
426
	 * parameter is true, the master and sub lists must be the same, otherwise,
427
	 * the sub list can be a subset of the master list.
428
	 * 
429
	 * @param mainAccessDAOList
430
	 *            The main list of DAOs
431
	 * @param subAccessDAOList
432
	 *            The sub list of DAOs
433
	 * @param exactMatch
434
	 *            if true, the master and sub lists must be exactly the same,
435
	 *            otherwise, the sublist must only be a subset of the master
436
	 */
437
	private void compareAccessDAOs(Vector<XMLAccessDAO> mainAccessDAOList, 
438
			Vector<XMLAccessDAO> subAccessDAOList, boolean exactMatch) {
439
		
440
		
441
		//debug("test access DAO: ");
442
		//debugAccessDAOList(subAccessDAOList);
443
		//debug("\naccess DAOs from database: ");
444
		//debugAccessDAOList(mainAccessDAOList);
445
		
446
		// if exactMatch is true, both lists must be the same size.  The next section will
447
		// make sure elements match.
448
		if (exactMatch) {
449
			if (mainAccessDAOList.size() != subAccessDAOList.size()) {
450
				fail("AccessAPITest.compareAccessDAOs - access DAO list sizes do not match.  " + 
451
						"Primary DAO list size: " + mainAccessDAOList.size() + 
452
						", secondary DAO list size: " + subAccessDAOList.size());
453
			}
454
		}
455
		
456
		// iterate through the sub list and make sure all its elements are in the master list
457
		for (XMLAccessDAO subAccessDAO : subAccessDAOList) {
458
			boolean matchFound = false;
459
			for (XMLAccessDAO mainAccessDAO : mainAccessDAOList) {				
460
				if (subAccessDAO.getDocId().equals(mainAccessDAO.getDocId()) &&
461
						subAccessDAO.getPermOrder().equals(mainAccessDAO.getPermOrder()) &&
462
						subAccessDAO.getPermType().equals(mainAccessDAO.getPermType()) &&
463
						subAccessDAO.getPrincipalName().equals(mainAccessDAO.getPrincipalName()) &&
464
						subAccessDAO.getPermission().equals(mainAccessDAO.getPermission())) {
465
					matchFound = true;
466
					break;
467
				}			
468
			}
469
			
470
			if (!matchFound) {
471
				fail("AccessAPITest.compareAccessDAOs - secondary access DAO does not exist in " + 
472
						"primary DAO list");
473
			}
474
		}
475
	}
476
	
477
	/**
478
	 * Get a vector of access DAO objects from an EML 2.1.0-like access section
479
	 * of xml
480
	 * 
481
	 * @param docId
482
	 *            the doc id that we are getting access for. this makes it
483
	 *            easier to create a DocInfoHandler object.
484
	 * @param accessXML
485
	 *            the access xml we want to parse.
486
	 * @return a list of XML access DAO objects.
487
	 */
488
	private Vector<XMLAccessDAO> getAccessDAOList(String docId, String accessXML) 
489
			throws AccessControlException {
490
		
491
		Vector<XMLAccessDAO> accessControlList = null;
492
		XMLReader parser = null;
493
		DocInfoHandler docInfoHandler = new DocInfoHandler(docId); 
494
		ContentHandler chandler = docInfoHandler;
495

    
496
		try {
497
			// Get an instance of the parser.  the DocInfoHandler will handle 
498
			// the extraction of access info.
499
			String parserName = PropertyService.getProperty("xml.saxparser");
500
			parser = XMLReaderFactory.createXMLReader(parserName);
501
	
502
			// Turn off validation
503
			parser.setFeature("http://xml.org/sax/features/validation", false);
504
			parser.setContentHandler((ContentHandler)chandler);
505
			parser.setErrorHandler((ErrorHandler)chandler);
506
	
507
			parser.parse(new InputSource(new StringReader(accessXML)));
508
				
509
			accessControlList = docInfoHandler.getAccessControlList();
510
		} catch (PropertyNotFoundException pnfe) {
511
			throw new AccessControlException("AccessAPITest.getAccessDAOList - " + 
512
					"property error: " + pnfe.getMessage());
513
		} catch (IOException ioe) {
514
			throw new AccessControlException("AccessAPITest.getAccessDAOList - " + 
515
					"I/O error: " + ioe.getMessage());
516
		} catch (SAXException se) {
517
			throw new AccessControlException("AccessAPITest.getAccessDAOList - " + 
518
					"SAX error: " + se.getMessage());
519
		}
520
        
521
        return accessControlList;
522
	}
523
	
524
	/**
525
	 * Print out the contents of an access DAO list
526
	 * @param accessDAOList
527
	 */
528
	private void debugAccessDAOList(Vector<XMLAccessDAO> accessDAOList) {
529
		for (XMLAccessDAO xmlAccessDAO : accessDAOList) {
530
			debug("Doc ID:      " + xmlAccessDAO.getDocId());
531
			debug("Perm Order:  " + xmlAccessDAO.getPermOrder());
532
			debug("Perm Type:   " + xmlAccessDAO.getPermType());
533
			debug("Principal    " + xmlAccessDAO.getPrincipalName());
534
			String permissionStr = 
535
				AccessControlList.txtValue(xmlAccessDAO.getPermission().intValue());
536
			debug("Permission   " + permissionStr);
537
		}
538
	}
539
}
(1-1/21)