mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 18:58:46 +02:00
Added comment to the element change log entries on permission schema change.
This commit is contained in:
parent
7b6a906d98
commit
751cdc603a
2 changed files with 11 additions and 2 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue