FieldVote example

$this->securityChecker = $securityChecker;
        $this->impersonateUrlGenerator = $impersonateUrlGenerator;
    }

    public function isGranted(mixed $role, mixed $object = null, string $field = null): bool
    {
        if (null === $this->securityChecker) {
            return false;
        }

        if (null !== $field) {
            $object = new FieldVote($object$field);
        }

        try {
            return $this->securityChecker->isGranted($role$object);
        } catch (AuthenticationCredentialsNotFoundException) {
            return false;
        }
    }

    public function getImpersonateExitUrl(string $exitTo = null): string
    {
        
Home | Imprint | This part of the site doesn't use cookies.