Added comment to the element change log entries on permission schema change.

This commit is contained in:
Jan Böhmer 2023-01-08 20:14:23 +01:00
parent 7b6a906d98
commit 751cdc603a
2 changed files with 11 additions and 2 deletions

View file

@ -23,6 +23,7 @@ namespace App\Command\User;
use App\Entity\UserSystem\Group;
use App\Entity\UserSystem\PermissionData;
use App\Entity\UserSystem\User;
use App\Services\LogSystem\EventCommentHelper;
use App\Services\UserSystem\PermissionSchemaUpdater;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Console\Command\Command;
@ -39,12 +40,14 @@ final class UpgradePermissionsSchemaCommand extends Command
private PermissionSchemaUpdater $permissionSchemaUpdater;
private EntityManagerInterface $em;
private EventCommentHelper $eventCommentHelper;
public function __construct(PermissionSchemaUpdater $permissionSchemaUpdater, EntityManagerInterface $entityManager)
public function __construct(PermissionSchemaUpdater $permissionSchemaUpdater, EntityManagerInterface $entityManager, EventCommentHelper $eventCommentHelper)
{
parent::__construct(self::$defaultName);
$this->permissionSchemaUpdater = $permissionSchemaUpdater;
$this->eventCommentHelper = $eventCommentHelper;
$this->em = $entityManager;
}
@ -112,6 +115,8 @@ final class UpgradePermissionsSchemaCommand extends Command
$this->permissionSchemaUpdater->upgradeSchema($user);
}
$this->eventCommentHelper->setMessage('Manual permissions schema update via CLI');
//Write changes to database
$this->em->flush();