@@ -64,7 +64,6 @@ edit a particular object. Here's an example implementation::
6464 use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
6565 use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
6666 use Symfony\Component\Security\Core\User\UserInterface;
67- use Acme\DemoBundle\Entity\Post;
6867
6968 class PostVoter implements VoterInterface
7069 {
@@ -79,9 +78,11 @@ edit a particular object. Here's an example implementation::
7978 ));
8079 }
8180
82- public function supportsClass($obj )
81+ public function supportsClass($class )
8382 {
84- return $obj instanceof Post;
83+ $supportedClass = 'Acme\DemoBundle\Entity\Post';
84+
85+ return $supportedClass === $class || is_subclass_of($class, $supportedClass);
8586 }
8687
8788 /**
@@ -90,7 +91,7 @@ edit a particular object. Here's an example implementation::
9091 public function vote(TokenInterface $token, $post, array $attributes)
9192 {
9293 // check if class of this object is supported by this voter
93- if (!$this->supportsClass($post)) {
94+ if (!$this->supportsClass(get_class( $post) )) {
9495 return VoterInterface::ACCESS_ABSTAIN;
9596 }
9697