Code Duplication    Length = 4-4 lines in 2 locations

lib/private/Share20/Manager.php 2 locations

@@ 218-221 (lines=4) @@
215
		}
216
217
		// Check if we actually have share permissions
218
		if (!$share->getNode()->isShareable()) {
219
			$message_t = $this->l->t('You are not allowed to share %s', [$share->getNode()->getPath()]);
220
			throw new GenericShareException($message_t, $message_t, 404);
221
		}
222
223
		// Permissions should be set
224
		if ($share->getPermissions() === null) {
@@ 240-243 (lines=4) @@
237
		}
238
239
		// Check that we do not share with more permissions than we have
240
		if ($share->getPermissions() & ~$permissions) {
241
			$message_t = $this->l->t('Cannot increase permissions of %s', [$share->getNode()->getPath()]);
242
			throw new GenericShareException($message_t, $message_t, 404);
243
		}
244
245
246
		// Check that read permissions are always set