diff options
Diffstat (limited to 'apps/files_sharing/api/share20ocs.php')
-rw-r--r-- | apps/files_sharing/api/share20ocs.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/files_sharing/api/share20ocs.php b/apps/files_sharing/api/share20ocs.php index 69e2f570499..003c028bf97 100644 --- a/apps/files_sharing/api/share20ocs.php +++ b/apps/files_sharing/api/share20ocs.php @@ -268,9 +268,9 @@ class Share20OCS { } $share->setPermissions( - \OCP\Constants::PERMISSION_READ | - \OCP\Constants::PERMISSION_CREATE | - \OCP\Constants::PERMISSION_UPDATE + \OCP\Constants::PERMISSION_READ | + \OCP\Constants::PERMISSION_CREATE | + \OCP\Constants::PERMISSION_UPDATE ); } else { $share->setPermissions(\OCP\Constants::PERMISSION_READ); @@ -303,7 +303,10 @@ class Share20OCS { try { $share = $this->shareManager->createShare($share); - } catch (\Exception $e) { + } catch (\OC\HintException $e) { + $code = $e->getCode() === 0 ? 403 : $e->getCode(); + return new \OC_OCS_Result(null, $code, $e->getHint()); + }catch (\Exception $e) { return new \OC_OCS_Result(null, 403, $e->getMessage()); } |