@@ -125,7 +125,7 @@ would look like this::
125
125
return false;
126
126
}
127
127
128
- // only vote on Post objects inside this voter
128
+ // only vote on ` Post` objects
129
129
if (!$subject instanceof Post) {
130
130
return false;
131
131
}
@@ -142,7 +142,7 @@ would look like this::
142
142
return false;
143
143
}
144
144
145
- // you know $subject is a Post object, thanks to supports
145
+ // you know $subject is a Post object, thanks to ` supports()`
146
146
/** @var Post $post */
147
147
$post = $subject;
148
148
@@ -163,15 +163,13 @@ would look like this::
163
163
return true;
164
164
}
165
165
166
- // the Post object could have, for example, a method isPrivate()
167
- // that checks a boolean $private property
166
+ // the Post object could have, for example, a method `isPrivate()`
168
167
return !$post->isPrivate();
169
168
}
170
169
171
170
private function canEdit(Post $post, User $user)
172
171
{
173
- // this assumes that the data object has a getOwner() method
174
- // to get the entity of the user who owns this data object
172
+ // this assumes that the Post object has a `getOwner()` method
175
173
return $user === $post->getOwner();
176
174
}
177
175
}
@@ -271,9 +269,8 @@ voters vote for one action and object. For instance, suppose you have one voter
271
269
checks if the user is a member of the site and a second one that checks if the user
272
270
is older than 18.
273
271
274
- To handle these cases, the access decision manager uses an access decision
275
- strategy. You can configure this to suit your needs. There are three
276
- strategies available:
272
+ To handle these cases, the access decision manager uses a "strategy" which you can configure.
273
+ There are three strategies available:
277
274
278
275
``affirmative `` (default)
279
276
This grants access as soon as there is *one * voter granting access;
0 commit comments