Project

General

Profile

Revision 6196

allow reading from xml_revision table when we are the doc owner

View differences:

src/edu/ucsb/nceas/metacat/PermissionController.java
522 522
      serialNumber=conn.getCheckOutSerialNumber();
523 523
      pStmt = conn.prepareStatement(
524 524
                "SELECT 'x' FROM xml_documents " +
525
                "WHERE docid = ? AND lower(user_owner) = ?");
525
                "WHERE docid = ? AND lower(user_owner) = ? " +
526
                "UNION ALL " +
527
                "SELECT 'x' FROM xml_revisions " +
528
                "WHERE docid = ? AND lower(user_owner) = ? ");
526 529
      //check every element in the string array too see if it conatains
527 530
      //the owner of document
528 531
      for (int i=0; i<lengthOfArray; i++)
......
531 534
        // Bind the values to the query
532 535
        pStmt.setString(1, docId);
533 536
        pStmt.setString(2, principals[i]);
537
        pStmt.setString(3, docId);
538
        pStmt.setString(4, principals[i]);
534 539
        logMetacat.info("PermissionController.containDocumentOwner - the principle stack is : " +
535 540
                                  principals[i]);
536 541

  

Also available in: Unified diff