\OCP\Share::SHARE_TYPE_USER,
\OCP\Share::SHARE_TYPE_GROUP,
\OCP\Share::SHARE_TYPE_LINK,
- \OCP\Share::SHARE_TYPE_REMOTE
+ \OCP\Share::SHARE_TYPE_REMOTE,
+ \OCP\Share::SHARE_TYPE_EMAIL
];
foreach ($requestedShareTypes as $requestedShareType) {
// one of each type is enough to find out about the types
$share->setSharedWith($shareWith);
$share->setPermissions($permissions);
} else if ($shareType === \OCP\Share::SHARE_TYPE_EMAIL) {
- $share->setPermissions(\OCP\Constants::PERMISSION_READ);
+ if ($share->getNodeType() === 'file') {
+ $share->setPermissions(\OCP\Constants::PERMISSION_READ);
+ } else {
+ $share->setPermissions(
+ \OCP\Constants::PERMISSION_READ |
+ \OCP\Constants::PERMISSION_CREATE |
+ \OCP\Constants::PERMISSION_UPDATE);
+ }
$share->setSharedWith($shareWith);
} else {
throw new OCSBadRequestException($this->l->t('Unknown share type'));