Skip to content

Commit

Permalink
Merge pull request #15814 from owncloud/public-reshare-webdav
Browse files Browse the repository at this point in the history
Fix webdav access for public reshare
  • Loading branch information
Vincent Petry committed Apr 23, 2015
2 parents d1ef96d + 7a3a8e4 commit a672e9d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 139 deletions.
44 changes: 0 additions & 44 deletions apps/files_sharing/lib/readonlycache.php

This file was deleted.

5 changes: 4 additions & 1 deletion apps/files_sharing/lib/readonlywrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@

namespace OCA\Files_Sharing;

use OC\Files\Cache\Wrapper\CachePermissionsMask;
use OC\Files\Storage\Wrapper\Wrapper;
use OCP\Constants;

class ReadOnlyWrapper extends Wrapper {
public function isUpdatable($path) {
Expand Down Expand Up @@ -66,6 +68,7 @@ public function getCache($path = '', $storage = null) {
if (!$storage) {
$storage = $this;
}
return new ReadOnlyCache($storage);
$sourceCache = $this->storage->getCache($path, $storage);
return new CachePermissionsMask($sourceCache, Constants::PERMISSION_READ | Constants::PERMISSION_SHARE);
}
}
3 changes: 2 additions & 1 deletion apps/files_sharing/publicwebdav.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
// wait with registering these until auth is handled and the filesystem is setup
$server->on('beforeMethod', function () use ($server, $objectTree, $authBackend) {
$share = $authBackend->getShare();
$owner = $share['uid_owner'];
$rootShare = \OCP\Share::resolveReShare($share);
$owner = $rootShare['uid_owner'];
$isWritable = $share['permissions'] & (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_CREATE);
$fileId = $share['file_source'];

Expand Down
93 changes: 0 additions & 93 deletions apps/files_sharing/tests/readonlycache.php

This file was deleted.

0 comments on commit a672e9d

Please sign in to comment.