10000 [Security] add & update doc entries on AbstractVoter implementation by javiereguiluz · Pull Request #5423 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Security] add & update doc entries on AbstractVoter implementation #5423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add fixes to abstract_voter include file
  • Loading branch information
inoryy authored and javiereguiluz committed Jun 22, 2015
commit 7619944f88965264da754d7d4ad7a70e12c0c84a
8 changes: 6 additions & 2 deletions cookbook/security/abstract_voter.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ The basic functionality covering common use cases is provided
and developer is expected to implement the abstract methods.

The :method:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\AbstractVoter::getSupportedClasses`
method is used to provide an array of supported classes, i.e. ['\Acme\DemoBundle\Model\Product']
method tells Symfony that your voter should be called whenever an object of one of the given classes
is passed to `isGranted` For example, if you return ['\Acme\DemoBundle\Model\Product'],
Symfony will call your voter when a `Product` object is passed to `isGranted`.

The :method:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\AbstractVoter::getSupportedAttributes`
method is used to provide an array of supported attributes, i.e. ['CREATE', 'READ']
method tells Symfony that your voter should be called whenever one of these strings is passes as the
first argument to `isGranted`. For example, if you return `array('CREATE', 'READ')`, then
Symfony will call your voter when one of these is passed to `isGranted`.

The :method:`Symfony\\Component\\Security\\Core\\Authorization\\Voter\\AbstractVoter::isGranted`
method must implement the business logic that verifies whether or not a given
Expand Down
0