Skip to content

Commit

Permalink
Merge branch '1.2' into 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmzig committed Nov 5, 2024
2 parents 6bc77a1 + 5224888 commit dafe781
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/Command/Update/IndexUpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected function configure(): void
->setName('generic-data-index:update:index')
->addOption(
self::OPTION_CLASS_DEFINITION_ID,
'cid',
'c',
InputOption::VALUE_OPTIONAL,
'Update mapping and data for specific data object classDefinition',
null
Expand Down
3 changes: 1 addition & 2 deletions src/Permission/BasePermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
*/
abstract class BasePermissions
{
// TODO: Change default value once development of API is finished
protected const DEFAULT_VALUE = true;
protected const DEFAULT_VALUE = false;

private bool $list = self::DEFAULT_VALUE;

Expand Down
30 changes: 15 additions & 15 deletions tests/Unit/Service/EventServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ final class EventServiceTest extends Unit
public function testDispatchAssetSearchEvent(): void
{
$permissions = new AssetPermissions();
$permissions->setView(false);
$permissions->setRename(false);
$permissions->setView(true);
$permissions->setRename(true);

$event = new Event\Asset\PermissionEvent(
new AssetSearchResultItem(),
Expand All @@ -51,16 +51,16 @@ public function testDispatchAssetSearchEvent(): void
);

$this->assertSame($event->getPermissions(), $returnedEvent->getPermissions());
$this->assertFalse($returnedEvent->getPermissions()->isView());
$this->assertFalse($returnedEvent->getPermissions()->isRename());
$this->assertTrue($returnedEvent->getPermissions()->isList());
$this->assertTrue($returnedEvent->getPermissions()->isView());
$this->assertTrue($returnedEvent->getPermissions()->isRename());
$this->assertFalse($returnedEvent->getPermissions()->isList());
}

public function testDispatchDataObjectSearchEvent(): void
{
$permissions = new DataObjectPermissions();
$permissions->setView(false);
$permissions->setRename(false);
$permissions->setView(true);
$permissions->setRename(true);

$event = new Event\DataObject\PermissionEvent(
new DataObjectSearchResultItem(),
Expand All @@ -74,16 +74,16 @@ public function testDispatchDataObjectSearchEvent(): void
);

$this->assertSame($event->getPermissions(), $returnedEvent->getPermissions());
$this->assertFalse($returnedEvent->getPermissions()->isView());
$this->assertFalse($returnedEvent->getPermissions()->isRename());
$this->assertTrue($returnedEvent->getPermissions()->isList());
$this->assertTrue($returnedEvent->getPermissions()->isView());
$this->assertTrue($returnedEvent->getPermissions()->isRename());
$this->assertFalse($returnedEvent->getPermissions()->isList());
}

public function testDispatchDocumentSearchEvent(): void
{
$permissions = new DocumentPermissions();
$permissions->setView(false);
$permissions->setList(false);
$permissions->setView(true);
$permissions->setList(true);

$event = new Event\Document\PermissionEvent(
new DocumentSearchResultItem(),
Expand All @@ -97,9 +97,9 @@ public function testDispatchDocumentSearchEvent(): void
);

$this->assertSame($event->getPermissions(), $returnedEvent->getPermissions());
$this->assertFalse($returnedEvent->getPermissions()->isView());
$this->assertFalse($returnedEvent->getPermissions()->isList());
$this->assertTrue($returnedEvent->getPermissions()->isPublish());
$this->assertTrue($returnedEvent->getPermissions()->isView());
$this->asserttrue($returnedEvent->getPermissions()->isList());
$this->assertFalse($returnedEvent->getPermissions()->isPublish());
}

public function testEventDispatcherCall(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Service/Permission/PermissionServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*/
final class PermissionServiceTest extends Unit
{
private const DEFAULT_VALUE = true;
private const DEFAULT_VALUE = false;

private User $user;

Expand Down

0 comments on commit dafe781

Please sign in to comment.