Code Duplication    Length = 4-4 lines in 2 locations

lib/private/Share20/Manager.php 2 locations

@@ 209-212 (lines=4) @@
206
		}
207
208
		// Check if we actually have share permissions
209
		if (!$share->getNode()->isShareable()) {
210
			$message_t = $this->l->t('You are not allowed to share %s', [$share->getNode()->getPath()]);
211
			throw new GenericShareException($message_t, $message_t, 404);
212
		}
213
214
		// Permissions should be set
215
		if ($share->getPermissions() === null) {
@@ 231-234 (lines=4) @@
228
		}
229
230
		// Check that we do not share with more permissions than we have
231
		if ($share->getPermissions() & ~$permissions) {
232
			$message_t = $this->l->t('Cannot increase permissions of %s', [$share->getNode()->getPath()]);
233
			throw new GenericShareException($message_t, $message_t, 404);
234
		}
235
236
		// Check that read permissions are always set
237
		if (($share->getPermissions() & \OCP\Constants::PERMISSION_READ) === 0) {