<?php
declare(strict_types=1);
namespace App\Access\Checker;
use Odiseo\SyliusRbacPlugin\Access\Checker\RouteNameCheckerInterface;
use Sylius\Bundle\AdminBundle\SectionResolver\AdminSection;
use Sylius\Bundle\CoreBundle\SectionResolver\SectionProviderInterface;
final class RouteNameChecker implements RouteNameCheckerInterface
{
private SectionProviderInterface $sectionProvider;
public function __construct(SectionProviderInterface $sectionProvider)
{
$this->sectionProvider = $sectionProvider;
}
public function isAdminRoute(string $routeName): bool
{
return $this->sectionProvider->getSection() instanceof AdminSection;
}
}
I can submit a PR if you're interested in the feature, otherwise just close it.
Example implementation:
I can submit a PR if you're interested in the feature, otherwise just close it.