Project

General

Profile

« Previous | Next » 

Revision 2652

Added by Jing Tao about 19 years ago

Fixed bug which can cause eml beta6 couldn't run access control.

View differences:

src/edu/ucsb/nceas/metacat/DocumentImpl.java
2490 2490
            String packagedoctype = MetaCatUtil.getOption("packagedoctype");
2491 2491
            Vector packagedoctypes = new Vector();
2492 2492
            packagedoctypes = MetaCatUtil.getOptionList(packagedoctype);
2493
            String docIdWithoutRev = MetaCatUtil.getDocIdFromString(accnumber);
2493
            String docIdWithoutRev = MetaCatUtil.getDocIdFromAccessionNumber(accnumber);
2494 2494
            int revision = MetaCatUtil.getRevisionFromAccessionNumber(accnumber);
2495 2495
            if (documenttype != null &&
2496 2496
                    packagedoctypes.contains(documenttype)) {
......
2499 2499
                serialNumber = dbconn.getCheckOutSerialNumber();
2500 2500
                dbconn.setAutoCommit(false);
2501 2501
                // from the relations get the access file id for that package
2502
                String aclid = RelationHandler.getAccessFileID(docIdWithoutRev);
2503
                // if there are access file, write ACL for that package
2504
                if (aclid != null) {
2502
                String aclidWithRev = RelationHandler.getAccessFileIDWithRevision(docIdWithoutRev);
2503
                if (aclidWithRev != null)
2504
                {
2505
                  String aclid = MetaCatUtil.getDocIdFromAccessionNumber(aclidWithRev);
2506
                  revision = MetaCatUtil.getRevisionFromAccessionNumber(aclidWithRev);
2507
                 
2508
                  // if there are access file, write ACL for that package
2509
                  if (aclid != null) {
2505 2510
                    runAccessControlList(dbconn, aclid, revision, userName, group,
2506 2511
                            servercode);
2512
                  }
2507 2513
                }
2508 2514
                dbconn.commit();
2509 2515
                dbconn.setAutoCommit(true);

Also available in: Unified diff