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 a8466d1426
commit 07ba4b2e4a
3 changed files with 7 additions and 7 deletions

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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();