File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,6 +110,17 @@ function (\Sabre\DAV\Server $server) use (
110110 if (!$ node ) {
111111 throw new \Sabre \DAV \Exception \NotFound ();
112112 }
113+
114+ // getFirstNodeById might return a node without share permission -> try to find a node which is shareable
115+ if (!$ node ->isShareable ()) {
116+ foreach ($ userFolder ->getById ($ fileId ) as $ candidate ) {
117+ if ($ candidate ->isShareable ()) {
118+ $ node = $ candidate ;
119+ break ;
120+ }
121+ }
122+ }
123+
113124 $ linkCheckPlugin ->setFileInfo ($ node );
114125
115126 // If not readable (files_drop) enable the filesdrop plugin
Original file line number Diff line number Diff line change 144144 if (!$ node ) {
145145 throw new NotFound ();
146146 }
147+
148+ // getFirstNodeById might return a node without share permission -> try to find a node which is shareable
149+ if (!$ node ->isShareable ()) {
150+ foreach ($ userFolder ->getById ($ fileId ) as $ candidate ) {
151+ if ($ candidate ->isShareable ()) {
152+ $ node = $ candidate ;
153+ break ;
154+ }
155+ }
156+ }
157+
147158 $ linkCheckPlugin ->setFileInfo ($ node );
148159
149160 // If not readable (files_drop) enable the filesdrop plugin
You can’t perform that action at this time.
0 commit comments