summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-01-06 11:34:12 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-01-06 15:25:29 +0100
commit1358e5dcd9af0ecace07115a790544a22d5eb3bd (patch)
tree88e1d8fd359f4c645da23436cee02b2aaa9aa7f5 /lib/private
parent26280e1f1965cd50325a05715989b1c0f7e508d0 (diff)
downloadnextcloud-server-1358e5dcd9af0ecace07115a790544a22d5eb3bd.tar.gz
nextcloud-server-1358e5dcd9af0ecace07115a790544a22d5eb3bd.zip
[Sharing 2.0] Some error cases report 404 instead of 403
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/share20/manager.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/share20/manager.php b/lib/private/share20/manager.php
index 216c4b9f5c1..8d753061c0c 100644
--- a/lib/private/share20/manager.php
+++ b/lib/private/share20/manager.php
@@ -33,6 +33,7 @@ use OCP\Files\Folder;
use OCP\IUser;
use OC\Share20\Exception\ShareNotFound;
+use OC\HintException;
/**
* This class is the communication hub for all sharing related operations.
@@ -175,7 +176,8 @@ class Manager {
// Check if we actually have share permissions
if (!$share->getPath()->isShareable()) {
- throw new \InvalidArgumentException('Path is not shareable');
+ $message_t = $this->l->t('You are not allowed to share %s', [$share->getPath()->getPath()]);
+ throw new HintException($message_t, $message_t, 404);
}
// Permissions should be set
@@ -185,7 +187,8 @@ class Manager {
// Check that we do not share with more permissions than we have
if ($share->getPermissions() & ~$share->getPath()->getPermissions()) {
- throw new \InvalidArgumentException('Cannot increase permissions');
+ $message_t = $this->l->t('Cannot increase permissions of %s', [$share->getPath()->getPath()]);
+ throw new HintException($message_t, $message_t, 404);
}
// Check that read permissions are always set