|
@@ 226-229 (lines=4) @@
|
| 223 |
|
} |
| 224 |
|
|
| 225 |
|
// Check if we actually have share permissions |
| 226 |
|
if (!$share->getNode()->isShareable()) { |
| 227 |
|
$message_t = $this->l->t('You are not allowed to share %s', [$share->getNode()->getPath()]); |
| 228 |
|
throw new GenericShareException($message_t, $message_t, 404); |
| 229 |
|
} |
| 230 |
|
|
| 231 |
|
// Permissions should be set |
| 232 |
|
if ($share->getPermissions() === null) { |
|
@@ 248-251 (lines=4) @@
|
| 245 |
|
} |
| 246 |
|
|
| 247 |
|
// Check that we do not share with more permissions than we have |
| 248 |
|
if ($share->getPermissions() & ~$permissions) { |
| 249 |
|
$message_t = $this->l->t('Cannot increase permissions of %s', [$share->getNode()->getPath()]); |
| 250 |
|
throw new GenericShareException($message_t, $message_t, 404); |
| 251 |
|
} |
| 252 |
|
|
| 253 |
|
if ($share->getNode() instanceof \OCP\Files\File) { |
| 254 |
|
if ($share->getPermissions() & \OCP\Constants::PERMISSION_DELETE) { |