File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
apps/dav/lib/Connector/Sabre Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 2121use OCP \Files \Folder ;
2222use OCP \Files \ForbiddenException ;
2323use OCP \Files \InvalidPathException ;
24+ use OCP \Files \IRootFolder ;
2425use OCP \Files \Mount \IMountManager ;
2526use OCP \Files \NotFoundException ;
2627use OCP \Files \NotPermittedException ;
@@ -556,15 +557,14 @@ public function getNodeForPath($path): INode {
556557
557558 // recurse upwards until the root (for backwards-compatibility)
558559 if ($ destinationDir !== '' ) {
559- $ scanNode = $ node -> getNode ()-> getParent () ;
560- $ scanPath = basename ( $ destinationDir );
561- while ( $ parent = $ scanNode -> getParent ()) {
562- $ parent -> get ( $ scanPath );
563- $ scanPath = $ parent -> getName ();
564- if ($ scanPath === '' ) {
565- break ;
560+ $ scanPath = $ destinationPath ;
561+ while (( $ scanPath = dirname ( $ scanPath )) !== ' / ' ) {
562+ $ info = $ this -> fileView -> getFileInfo ( $ scanPath , false );
563+ $ directory = new Directory ( $ this -> fileView , $ info , $ this -> tree , $ this -> shareManager );
564+ $ readable = $ directory -> getNode ()-> isReadable ();
565+ if (! $ readable ) {
566+ throw new Forbidden ( ' No read permissions. This might be caused by files_accesscontrol, check your configured rules ' ) ;
566567 }
567- $ scanNode = $ parent ;
568568 }
569569 }
570570
You can’t perform that action at this time.
0 commit comments