Layout of saved export page

This commit is contained in:
2025-04-14 10:59:31 +02:00
parent 9f12b42961
commit 3d9b9ea672
8 changed files with 143 additions and 61 deletions

View File

@@ -11,6 +11,9 @@ declare(strict_types=1);
namespace Chill\MainBundle\Security\Authorization;
use Chill\MainBundle\Export\DirectExportInterface;
use Chill\MainBundle\Export\ExportInterface;
use Chill\MainBundle\Export\ExportManager;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
@@ -20,7 +23,7 @@ class ChillExportVoter extends Voter
private readonly VoterHelperInterface $helper;
public function __construct(VoterHelperFactoryInterface $voterHelperFactory)
public function __construct(VoterHelperFactoryInterface $voterHelperFactory, ExportManager $exportManager)
{
$this->helper = $voterHelperFactory
->generate(self::class)
@@ -30,6 +33,13 @@ class ChillExportVoter extends Voter
protected function supports($attribute, $subject): bool
{
if (
($subject instanceof ExportInterface or $subject instanceof DirectExportInterface)
&& $attribute === $subject->requiredRole()
) {
return true;
}
return $this->helper->supports($attribute, $subject);
}