Skip to content

Commit 6c7f46d

Browse files
committed
Add error message for forbidden local mount
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
1 parent 3847d98 commit 6c7f46d

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

apps/files_external/lib/Controller/GlobalStoragesController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ public function create(
103103
$canCreateNewLocalStorage = $this->config->getSystemValue('files_external_allow_create_new_local', false);
104104
if (!$canCreateNewLocalStorage && $backend === 'local') {
105105
return new DataResponse(
106-
null,
106+
[
107+
'message' => $this->l10n->t('Forbidden to manage local mounts')
108+
],
107109
Http::STATUS_FORBIDDEN
108110
);
109111
}

apps/files_external/lib/Controller/StoragesController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ protected function createStorage(
140140
$canCreateNewLocalStorage = $this->config->getSystemValue('files_external_allow_create_new_local', false);
141141
if (!$canCreateNewLocalStorage && $backend === 'local') {
142142
return new DataResponse(
143-
null,
143+
[
144+
'message' => $this->l10n->t('Forbidden to manage local mounts')
145+
],
144146
Http::STATUS_FORBIDDEN
145147
);
146148
}

apps/files_external/lib/Controller/UserStoragesController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ public function create(
133133
$canCreateNewLocalStorage = $this->config->getSystemValue('files_external_allow_create_new_local', false);
134134
if (!$canCreateNewLocalStorage && $backend === 'local') {
135135
return new DataResponse(
136-
null,
136+
[
137+
'message' => $this->l10n->t('Forbidden to manage local mounts')
138+
],
137139
Http::STATUS_FORBIDDEN
138140
);
139141
}

0 commit comments

Comments
 (0)