fix: Only map owner for user mapping

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-08-11 18:47:38 +02:00
parent 5b81f4b614
commit 3a5d5bd449
3 changed files with 7 additions and 7 deletions

View File

@@ -78,7 +78,7 @@ class DeckJsonService extends ABoardImportService {
public function mapMember($uid): ?string { public function mapMember($uid): ?string {
$ownerMap = $this->mapOwner($uid); $ownerMap = $this->mapOwner($uid);
if ($ownerMap !== $uid) { if ($uid === $this->getImportService()->getData()->owner && $ownerMap !== $this->getImportService()->getData()->owner) {
return $ownerMap; return $ownerMap;
} }

View File

@@ -277,7 +277,7 @@ class TransferOwnershipTest extends \Test\TestCase {
// Arrange separate board next to the one being transferred // Arrange separate board next to the one being transferred
$board = $this->boardService->create('Test 2', self::TEST_USER_1, '000000'); $board = $this->boardService->create('Test 2', self::TEST_USER_1, '000000');
$id = $board->getId(); $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_GROUP, self::TEST_GROUP, true, true, true);
$this->boardService->addAcl($id, Acl::PERMISSION_TYPE_USER, self::TEST_USER_3, false, true, false); $this->boardService->addAcl($id, Acl::PERMISSION_TYPE_USER, self::TEST_USER_3, false, true, false);
$stacks[] = $this->stackService->create('Stack A', $id, 1); $stacks[] = $this->stackService->create('Stack A', $id, 1);

View File

@@ -49,11 +49,11 @@ use Symfony\Component\Console\Output\OutputInterface;
class ImportExportTest extends \Test\TestCase { class ImportExportTest extends \Test\TestCase {
private IDBConnection $connection; private IDBConnection $connection;
private const TEST_USER1 = 'test-share-user1'; private const TEST_USER1 = 'test-export-user1';
private const TEST_USER3 = 'test-share-user3'; private const TEST_USER3 = 'test-export-user3';
private const TEST_USER2 = 'test-share-user2'; private const TEST_USER2 = 'test-export-user2';
private const TEST_USER4 = 'test-share-user4'; private const TEST_USER4 = 'test-export-user4';
private const TEST_GROUP1 = 'test-share-group1'; private const TEST_GROUP1 = 'test-export-group1';
public static function setUpBeforeClass(): void { public static function setUpBeforeClass(): void {
parent::setUpBeforeClass(); parent::setUpBeforeClass();