@@ -24,8 +24,9 @@ All voters are called each time you use the ``isGranted()`` method on Symfony's
2424security context (i.e. the ``security.context `` service). Each one decides
2525if the current user should have access to some resource.
2626
27- Ultimately, Symfony uses one of three different approaches on what to do
28- with the feedback from all voters: affirmative, consensus and unanimous.
27+ Ultimately, Symfony takes the responses from all voters and makes the final
28+ decission (to allow or deny access to the resource) according to the strategy defined
29+ in the application, which can be: affirmative, consensus or unanimous.
2930
3031For more information take a look at
3132:ref: `the section about access decision managers <components-security-access-decision-manager >`.
@@ -49,7 +50,7 @@ method is used to check if the voter supports the given user attribute (i.e:
4950a role like ``ROLE_USER ``, an ACL ``EDIT ``, etc.).
5051
5152The:method: `Symfony\\ Component\\ Security\\ Core\\ Authorization\\ Voter\\ VoterInterface::supportsClass `
52- methodis used to check if the voter supports the class of the object whose
53+ methodchecks whether the voter supports the class of the object whose
5354access is being checked.
5455
5556The:method: `Symfony\\ Component\\ Security\\ Core\\ Authorization\\ Voter\\ VoterInterface::vote `
@@ -87,10 +88,7 @@ edit a particular object. Here's an example implementation::
8788
8889 public function supportsAttribute($attribute)
8990 {
90- return in_array($attribute, array(
91- self::VIEW,
92- self::EDIT,
93- ));
91+ return in_array($attribute, array(self::VIEW, self::EDIT));
9492 }
9593
9694 public function supportsClass($class)
@@ -229,7 +227,7 @@ from the security context is called.
229227
230228 // keep in mind, this will call all registered security voters
231229 if (false === $this->get('security.context')->isGranted('view', $post)) {
232- throw new AccessDeniedException('Unauthorised access!');
230+ throw new AccessDeniedException('Unauthorized access!');
233231 }
234232
235233 return new Response('<h1 >'.$post->getName().'</h1 >');