diff options
author | Joas Schilling <coding@schilljs.com> | 2016-07-14 10:27:29 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-07-14 10:27:29 +0200 |
commit | 76736731eb7e4e4b73774550f7c8681d80780705 (patch) | |
tree | 714ed8504da74781d77133a70cb301b2d5b4e0cc /apps/files_sharing | |
parent | 1df65e987229ecf1044e01743b0a33df04001e53 (diff) | |
download | nextcloud-server-76736731eb7e4e4b73774550f7c8681d80780705.tar.gz nextcloud-server-76736731eb7e4e4b73774550f7c8681d80780705.zip |
Allow shares with create permissions only aswell
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/API/Share20OCS.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/API/Share20OCS.php b/apps/files_sharing/lib/API/Share20OCS.php index 436b8d15ac8..9d7aeffcc1b 100644 --- a/apps/files_sharing/lib/API/Share20OCS.php +++ b/apps/files_sharing/lib/API/Share20OCS.php @@ -602,11 +602,12 @@ class Share20OCS { } if ($newPermissions !== null && - $newPermissions !== \OCP\Constants::PERMISSION_READ && - // legacy - $newPermissions !== (\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE) && - // correct - $newPermissions !== (\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE) + !in_array($newPermissions, [ + \OCP\Constants::PERMISSION_READ, + \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE, // legacy + \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE, // correct + \OCP\Constants::PERMISSION_CREATE, // hidden file list + ]) ) { $share->getNode()->unlock(ILockingProvider::LOCK_SHARED); return new \OC_OCS_Result(null, 400, $this->l->t('Can\'t change permissions for public share links')); |