From 07ba4b2e4a566bab0a8312461f6bac56cf6e0a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 11 Aug 2023 18:47:38 +0200 Subject: [PATCH] fix: Only map owner for user mapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Service/Importer/Systems/DeckJsonService.php | 2 +- tests/integration/database/TransferOwnershipTest.php | 2 +- tests/integration/import/ImportExportTest.php | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Service/Importer/Systems/DeckJsonService.php b/lib/Service/Importer/Systems/DeckJsonService.php index 4e4af4144..0fcef4ba0 100644 --- a/lib/Service/Importer/Systems/DeckJsonService.php +++ b/lib/Service/Importer/Systems/DeckJsonService.php @@ -78,7 +78,7 @@ class DeckJsonService extends ABoardImportService { public function mapMember($uid): ?string { $ownerMap = $this->mapOwner($uid); - if ($ownerMap !== $uid) { + if ($uid === $this->getImportService()->getData()->owner && $ownerMap !== $this->getImportService()->getData()->owner) { return $ownerMap; } diff --git a/tests/integration/database/TransferOwnershipTest.php b/tests/integration/database/TransferOwnershipTest.php index bba5e12dd..c17d8b7fc 100644 --- a/tests/integration/database/TransferOwnershipTest.php +++ b/tests/integration/database/TransferOwnershipTest.php @@ -277,7 +277,7 @@ class TransferOwnershipTest extends \Test\TestCase { // Arrange separate board next to the one being transferred $board = $this->boardService->create('Test 2', self::TEST_USER_1, '000000'); $id = $board->getId(); - $this->boardService->addAcl($id, Acl::PERMISSION_TYPE_USER, self::TEST_USER_1, true, true, true); + // $this->boardService->addAcl($id, Acl::PERMISSION_TYPE_USER, self::TEST_USER_1, true, true, true); $this->boardService->addAcl($id, Acl::PERMISSION_TYPE_GROUP, self::TEST_GROUP, true, true, true); $this->boardService->addAcl($id, Acl::PERMISSION_TYPE_USER, self::TEST_USER_3, false, true, false); $stacks[] = $this->stackService->create('Stack A', $id, 1); diff --git a/tests/integration/import/ImportExportTest.php b/tests/integration/import/ImportExportTest.php index 64c14207a..0577fc442 100644 --- a/tests/integration/import/ImportExportTest.php +++ b/tests/integration/import/ImportExportTest.php @@ -49,11 +49,11 @@ use Symfony\Component\Console\Output\OutputInterface; class ImportExportTest extends \Test\TestCase { private IDBConnection $connection; - private const TEST_USER1 = 'test-share-user1'; - private const TEST_USER3 = 'test-share-user3'; - private const TEST_USER2 = 'test-share-user2'; - private const TEST_USER4 = 'test-share-user4'; - private const TEST_GROUP1 = 'test-share-group1'; + private const TEST_USER1 = 'test-export-user1'; + private const TEST_USER3 = 'test-export-user3'; + private const TEST_USER2 = 'test-export-user2'; + private const TEST_USER4 = 'test-export-user4'; + private const TEST_GROUP1 = 'test-export-group1'; public static function setUpBeforeClass(): void { parent::setUpBeforeClass();