summaryrefslogtreecommitdiffstats
path: root/apps/files_external/controller
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-08-28 15:52:29 +0100
committerRobin McCorkell <rmccorkell@owncloud.com>2015-08-28 17:21:58 +0100
commitcc88c5f4b84da57c425cbdb7dc8b391b1942b503 (patch)
tree2a55a4138f7adfd49eefd9277e9f8ba17f747857 /apps/files_external/controller
parent080fafe63a980f6a485027fd4216864adf764e1e (diff)
downloadnextcloud-server-cc88c5f4b84da57c425cbdb7dc8b391b1942b503.tar.gz
nextcloud-server-cc88c5f4b84da57c425cbdb7dc8b391b1942b503.zip
Implement more fine-grained external storage permissions model
VisibilityTrait -> PermissionsTrait PermissionsTrait stores two sets of data, $permissions and $allowedPermissions (analogous to $visibility and $allowedVisibility of VisibilityTrait). Each set is a map of user type ('admin' or 'personal') to permissions (mounting permission, create permission). The result is that a backend can now be restricted for creation, while still allowing it to be mounted. This is useful for deprecating backends or auth mechanisms, preventing new storages being created, while still allowing existing storages to be mounted.
Diffstat (limited to 'apps/files_external/controller')
-rw-r--r--apps/files_external/controller/userstoragescontroller.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/files_external/controller/userstoragescontroller.php b/apps/files_external/controller/userstoragescontroller.php
index 0d41e088a76..9baac3a8031 100644
--- a/apps/files_external/controller/userstoragescontroller.php
+++ b/apps/files_external/controller/userstoragescontroller.php
@@ -79,7 +79,7 @@ class UserStoragesController extends StoragesController {
// Prevent non-admin users from mounting local storage and other disabled backends
/** @var Backend */
$backend = $storage->getBackend();
- if (!$backend->isVisibleFor(BackendService::VISIBILITY_PERSONAL)) {
+ if (!$backend->isPermitted(BackendService::USER_PERSONAL, BackendService::PERMISSION_MOUNT)) {
return new DataResponse(
array(
'message' => (string)$this->l10n->t('Admin-only storage backend "%s"', [