diff options
author | Robin McCorkell <rmccorkell@owncloud.com> | 2015-09-17 10:24:19 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-23 12:10:02 +0200 |
commit | 38a260e963abd04b75aff8d67a8cf7b3b20a9c67 (patch) | |
tree | eb118da0cdd9819657efa8fbf58c6c754c4cf19c /apps/files_external/controller | |
parent | ee649d58c5f82ee209ddc1812c1a896da53de707 (diff) | |
download | nextcloud-server-38a260e963abd04b75aff8d67a8cf7b3b20a9c67.tar.gz nextcloud-server-38a260e963abd04b75aff8d67a8cf7b3b20a9c67.zip |
Revert "Implement more fine-grained external storage permissions model"
This reverts commit 0b97a05e7bd631d66de1c2aee115113ada8a5f63.
This reverts commit d2e3c17c0000bc0020f1ff641190452f370434de.
This reverts commit cc88c5f4b84da57c425cbdb7dc8b391b1942b503.
Diffstat (limited to 'apps/files_external/controller')
3 files changed, 18 insertions, 19 deletions
diff --git a/apps/files_external/controller/globalstoragescontroller.php b/apps/files_external/controller/globalstoragescontroller.php index 7d97fdbb4f4..3686a6189b4 100644 --- a/apps/files_external/controller/globalstoragescontroller.php +++ b/apps/files_external/controller/globalstoragescontroller.php @@ -98,7 +98,7 @@ class GlobalStoragesController extends StoragesController { return $newStorage; } - $response = $this->validate($newStorage, BackendService::PERMISSION_CREATE); + $response = $this->validate($newStorage); if (!empty($response)) { return $response; } @@ -154,7 +154,7 @@ class GlobalStoragesController extends StoragesController { } $storage->setId($id); - $response = $this->validate($storage, BackendService::PERMISSION_MODIFY); + $response = $this->validate($storage); if (!empty($response)) { return $response; } @@ -180,12 +180,12 @@ class GlobalStoragesController extends StoragesController { } /** - * Get the user type for this controller, used in validation + * Get the visibility type for this controller, used in validation * - * @return string BackendService::USER_* constants + * @return string BackendService::VISIBILITY_* constants */ - protected function getUserType() { - return BackendService::USER_ADMIN; + protected function getVisibilityType() { + return BackendService::VISIBILITY_ADMIN; } diff --git a/apps/files_external/controller/storagescontroller.php b/apps/files_external/controller/storagescontroller.php index 46202c8ba4a..71055fd1b9c 100644 --- a/apps/files_external/controller/storagescontroller.php +++ b/apps/files_external/controller/storagescontroller.php @@ -125,11 +125,10 @@ abstract class StoragesController extends Controller { * Validate storage config * * @param StorageConfig $storage storage config - * @param int $permissionCheck permission to check * * @return DataResponse|null returns response in case of validation error */ - protected function validate(StorageConfig $storage, $permissionCheck = BackendService::PERMISSION_CREATE) { + protected function validate(StorageConfig $storage) { $mountPoint = $storage->getMountPoint(); if ($mountPoint === '' || $mountPoint === '/') { return new DataResponse( @@ -166,7 +165,7 @@ abstract class StoragesController extends Controller { ); } - if (!$backend->isPermitted($this->getUserType(), $permissionCheck)) { + if (!$backend->isVisibleFor($this->getVisibilityType())) { // not permitted to use backend return new DataResponse( array( @@ -177,7 +176,7 @@ abstract class StoragesController extends Controller { Http::STATUS_UNPROCESSABLE_ENTITY ); } - if (!$authMechanism->isPermitted($this->getUserType(), $permissionCheck)) { + if (!$authMechanism->isVisibleFor($this->getVisibilityType())) { // not permitted to use auth mechanism return new DataResponse( array( @@ -212,11 +211,11 @@ abstract class StoragesController extends Controller { } /** - * Get the user type for this controller, used in validation + * Get the visibility type for this controller, used in validation * - * @return string BackendService::USER_* constants + * @return string BackendService::VISIBILITY_* constants */ - abstract protected function getUserType(); + abstract protected function getVisibilityType(); /** * Check whether the given storage is available / valid. diff --git a/apps/files_external/controller/userstoragescontroller.php b/apps/files_external/controller/userstoragescontroller.php index 801c9ab0aae..fcbe692d79e 100644 --- a/apps/files_external/controller/userstoragescontroller.php +++ b/apps/files_external/controller/userstoragescontroller.php @@ -103,7 +103,7 @@ class UserStoragesController extends StoragesController { return $newStorage; } - $response = $this->validate($newStorage, BackendService::PERMISSION_CREATE); + $response = $this->validate($newStorage); if (!empty($response)) { return $response; } @@ -151,7 +151,7 @@ class UserStoragesController extends StoragesController { } $storage->setId($id); - $response = $this->validate($storage, BackendService::PERMISSION_MODIFY); + $response = $this->validate($storage); if (!empty($response)) { return $response; } @@ -188,12 +188,12 @@ class UserStoragesController extends StoragesController { } /** - * Get the user type for this controller, used in validation + * Get the visibility type for this controller, used in validation * - * @return string BackendService::USER_* constants + * @return string BackendService::VISIBILITY_* constants */ - protected function getUserType() { - return BackendService::USER_PERSONAL; + protected function getVisibilityType() { + return BackendService::VISIBILITY_PERSONAL; } } |