@@ -384,14 +384,21 @@ public function isSharable($path): bool {
384
384
385
385
public function getPermissions ($ path ): int {
386
386
$ response = $ this ->propfind ($ path );
387
+ if ($ response === false ) {
388
+ return 0 ;
389
+ }
390
+
391
+ $ ocsPermissions = $ response ['{http://open-collaboration-services.org/ns}share-permissions ' ] ?? null ;
392
+ $ ocmPermissions = $ response ['{http://open-cloud-mesh.org/ns}share-permissions ' ] ?? null ;
393
+ $ ocPermissions = $ response ['{http://owncloud.org/ns}permissions ' ] ?? null ;
387
394
// old federated sharing permissions
388
- if (isset ( $ response [ ' {http://open-collaboration-services.org/ns}share-permissions ' ]) ) {
389
- $ permissions = (int )$ response [ ' {http://open-collaboration-services.org/ns}share-permissions ' ] ;
390
- } elseif (isset ( $ response [ ' {http://open-cloud-mesh.org/ns}share-permissions ' ]) ) {
395
+ if ($ ocsPermissions !== null ) {
396
+ $ permissions = (int )$ ocsPermissions ;
397
+ } elseif ($ ocmPermissions !== null ) {
391
398
// permissions provided by the OCM API
392
- $ permissions = $ this ->ocmPermissions2ncPermissions ($ response [ ' {http://open-collaboration-services.org/ns}share-permissions ' ] , $ path );
393
- } elseif (isset ( $ response [ ' {http://owncloud.org/ns}permissions ' ]) ) {
394
- return $ this ->parsePermissions ($ response [ ' {http://owncloud.org/ns}permissions ' ] );
399
+ $ permissions = $ this ->ocmPermissions2ncPermissions ($ ocmPermissions , $ path );
400
+ } elseif ($ ocPermissions !== null ) {
401
+ return $ this ->parsePermissions ($ ocPermissions );
395
402
} else {
396
403
// use default permission if remote server doesn't provide the share permissions
397
404
$ permissions = $ this ->getDefaultPermissions ($ path );
0 commit comments