2014-06-12 19:53:56 +04:00
|
|
|
<?php
|
|
|
|
/**
|
2015-02-26 13:37:37 +03:00
|
|
|
* Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
2014-06-12 19:53:56 +04:00
|
|
|
*/
|
2015-02-26 13:37:37 +03:00
|
|
|
|
2014-06-12 19:53:56 +04:00
|
|
|
namespace OCA\Files_Sharing;
|
|
|
|
|
|
|
|
use OC\Files\Storage\Wrapper\Wrapper;
|
|
|
|
|
|
|
|
class ReadOnlyWrapper extends Wrapper {
|
|
|
|
public function isUpdatable($path) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function isCreatable($path) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function isDeletable($path) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPermissions($path) {
|
2014-11-25 18:28:41 +03:00
|
|
|
return $this->storage->getPermissions($path) & (\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_SHARE);
|
2014-06-12 19:53:56 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function rename($path1, $path2) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function touch($path, $mtime = null) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function mkdir($path) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function rmdir($path) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function unlink($path) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getCache($path = '', $storage = null) {
|
|
|
|
if (!$storage) {
|
|
|
|
$storage = $this;
|
|
|
|
}
|
|
|
|
return new ReadOnlyCache($storage);
|
|
|
|
}
|
|
|
|
}
|