Project

General

Profile

« Previous | Next » 

Revision 5098

Added by daigle over 14 years ago

change AccessControlForSingleFile to only be instantiated for one file. move ACL methods to AccessControlForSingleFile. Change format of access sections returned to EML 2.1.0.

View differences:

ReplicationHandler.java
33 33
import edu.ucsb.nceas.metacat.DocumentImplWrapper;
34 34
import edu.ucsb.nceas.metacat.EventLog;
35 35
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlForSingleFile;
36
import edu.ucsb.nceas.metacat.accesscontrol.XMLAccessDAO;
36 37
import edu.ucsb.nceas.metacat.database.DBConnection;
37 38
import edu.ucsb.nceas.metacat.database.DBConnectionPool;
38 39
import edu.ucsb.nceas.metacat.database.DatabaseService;
......
358 359
                              createdDate,
359 360
                              updatedDate);
360 361
      
361
      //process extra access rules
362
      Vector<AccessControlForSingleFile> accessControlList = dih.getAccessControlList();
363
      if (accessControlList != null) {
364
    	  for (AccessControlForSingleFile acfsf : accessControlList) {
365
        	  if (!acfsf.accessControlExists()) {
366
        		  acfsf.insertPermissions();
367
        	  }
362
      //process extra access rules 
363
      Vector<XMLAccessDAO> xmlAccessDAOList = dih.getAccessControlList();
364
      if (xmlAccessDAOList != null) {
365
      	AccessControlForSingleFile acfsf = new AccessControlForSingleFile(accNumber);
366
      	for (XMLAccessDAO xmlAccessDAO : xmlAccessDAOList) {
367
      		if (!acfsf.accessControlExists(xmlAccessDAO)) {
368
      			acfsf.insertPermissions(xmlAccessDAO);
369
      		}
368 370
          }
369 371
      }
370 372
      
......
488 490
                                                updatedDate);
489 491
                                         
490 492
        //process extra access rules
491
        Vector<AccessControlForSingleFile> accessControlList = dih.getAccessControlList();
492
        if (accessControlList != null) {
493
      	  for (AccessControlForSingleFile acfsf : accessControlList) {
494
          	  if (!acfsf.accessControlExists()) {
495
          		acfsf.insertPermissions();
496
          	  }
493
        Vector<XMLAccessDAO> xmlAccessDAOList = dih.getAccessControlList();
494
        if (xmlAccessDAOList != null) {
495
        	AccessControlForSingleFile acfsf = new AccessControlForSingleFile(accNumber);
496
        	for (XMLAccessDAO xmlAccessDAO : xmlAccessDAOList) {
497
        		if (!acfsf.accessControlExists(xmlAccessDAO)) {
498
        			acfsf.insertPermissions(xmlAccessDAO);
499
        		}
497 500
            }
498 501
        }
499 502
        

Also available in: Unified diff