Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid storage wrapper extension #75

Merged
merged 1 commit into from
Aug 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions lib/StorageWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
namespace OCA\FilesAccessControl;

use OC\Files\Storage\Wrapper\Wrapper;
use OCP\Files\ForbiddenException;
use OCP\Files\Storage\IStorage;

class StorageWrapper extends Wrapper {

Expand Down Expand Up @@ -144,7 +146,7 @@ public function rmdir($path) {
public function isCreatable($path) {
try {
$this->checkFileAccess($path);
} catch (\OCP\Files\ForbiddenException $e) {
} catch (ForbiddenException $e) {
return false;
}
return $this->storage->isCreatable($path);
Expand All @@ -159,7 +161,7 @@ public function isCreatable($path) {
public function isReadable($path) {
try {
$this->checkFileAccess($path);
} catch (\OCP\Files\ForbiddenException $e) {
} catch (ForbiddenException $e) {
return false;
}
return $this->storage->isReadable($path);
Expand All @@ -174,7 +176,7 @@ public function isReadable($path) {
public function isUpdatable($path) {
try {
$this->checkFileAccess($path);
} catch (\OCP\Files\ForbiddenException $e) {
} catch (ForbiddenException $e) {
return false;
}
return $this->storage->isUpdatable($path);
Expand All @@ -189,7 +191,7 @@ public function isUpdatable($path) {
public function isDeletable($path) {
try {
$this->checkFileAccess($path);
} catch (\OCP\Files\ForbiddenException $e) {
} catch (ForbiddenException $e) {
return false;
}
return $this->storage->isDeletable($path);
Expand Down Expand Up @@ -555,12 +557,12 @@ public function getDirectDownload($path) {
// }

/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
*/
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
if ($sourceStorage === $this) {
return $this->copy($sourceInternalPath, $targetInternalPath);
}
Expand All @@ -570,12 +572,12 @@ public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceIntern
}

/**
* @param \OCP\Files\Storage $sourceStorage
* @param IStorage $sourceStorage
* @param string $sourceInternalPath
* @param string $targetInternalPath
* @return bool
*/
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
public function moveFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
if ($sourceStorage === $this) {
return $this->rename($sourceInternalPath, $targetInternalPath);
}
Expand Down