From: Wolfgang M. M. <wol...@us...> - 2004-07-02 16:54:06
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15785/src/org/exist/storage Modified Files: NativeBroker.java Log Message: Fixed resource read/write permissions check. Index: NativeBroker.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeBroker.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** NativeBroker.java 29 Jun 2004 14:26:48 -0000 1.84 --- NativeBroker.java 2 Jul 2004 16:53:57 -0000 1.85 *************** *** 335,339 **** long start = System.currentTimeMillis(); Collection root = getCollection(ROOT_COLLECTION); ! root.allDocs(this, docs, true); if (LOG.isDebugEnabled()) { LOG.debug("getAllDocuments(DocumentSet) - end - " --- 335,339 ---- long start = System.currentTimeMillis(); Collection root = getCollection(ROOT_COLLECTION); ! root.allDocs(this, docs, true, false); if (LOG.isDebugEnabled()) { LOG.debug("getAllDocuments(DocumentSet) - end - " *************** *** 514,519 **** return null; } ! if (!doc.getPermissions().validate(user, Permission.READ)) ! throw new PermissionDeniedException("not allowed to read document"); return doc; } --- 514,519 ---- return null; } ! // if (!doc.getPermissions().validate(user, Permission.READ)) ! // throw new PermissionDeniedException("not allowed to read document"); return doc; } *************** *** 541,545 **** return docs; } ! docs = root.allDocs(this, docs, inclusive); LOG.debug( "loading " --- 541,545 ---- return docs; } ! docs = root.allDocs(this, docs, inclusive, false); LOG.debug( "loading " *************** *** 1905,1908 **** --- 1905,1911 ---- throw new PermissionDeniedException("Insufficient privileges to move resource " + doc.getFileName()); + if(!doc.getPermissions().validate(user, Permission.WRITE)) + throw new PermissionDeniedException("Insufficient privileges to move resource " + + doc.getFileName()); if(newName == null) { int p = doc.getFileName().lastIndexOf('/'); |