Skip to content

Commit 2f89b3a

Browse files
committed
[#3326] Tweaks to voter wording
1 parent 5d0acc7 commit 2f89b3a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cookbook/security/voters.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ How to implement your own Voter to blacklist IP Addresses
55
=========================================================
66

77
The Symfony2 Security component provides several layers to authorize users.
8-
One of the layers is called a `voter`. A voter is a dedicated class that checks
9-
if the user has the rights to be connected to the application. For instance,
10-
Symfony2 provides a layer that checks if the user is fully authorized or if
11-
it has some expected roles.
8+
One of the layers is called a "voter". A voter is a dedicated class that checks
9+
if the user has the rights to connect to the application or access a specific
10+
resource/URL. For instance, Symfony2 provides a layer that checks if the user
11+
is fully authorized or if it has some expected roles.
1212

1313
It is sometimes useful to create a custom voter to handle a specific case not
1414
handled by the framework. In this section, you'll learn how to create a voter
@@ -34,15 +34,15 @@ The ``supportsAttribute()`` method is used to check if the voter supports
3434
the given user attribute (i.e: a role, an ACL, etc.).
3535

3636
The ``supportsClass()`` method is used to check if the voter supports the
37-
current user token class.
37+
class of the object whose access is being checked (doesn't apply to this entry).
3838

3939
The ``vote()`` method must implement the business logic that verifies whether
4040
or not the user is granted access. This method must return one of the following
4141
values:
4242

43-
* ``VoterInterface::ACCESS_GRANTED``: The user is allowed to access something
44-
* ``VoterInterface::ACCESS_ABSTAIN``: The voter cannot decide if the user is granted or not
45-
* ``VoterInterface::ACCESS_DENIED``: The user is not allowed to access something
43+
* ``VoterInterface::ACCESS_GRANTED``: The authorization will be granted by this voter;
44+
* ``VoterInterface::ACCESS_ABSTAIN``: The voter cannot decide if authorization should be granted;
45+
* ``VoterInterface::ACCESS_DENIED``: The authorization will be denied by this voter.
4646

4747
In this example, you'll check if the user's IP address matches against a list of
4848
blacklisted addresses and "something" will be the application. If the user's IP is blacklisted, you'll return

0 commit comments

Comments
 (0)