File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -1040,6 +1040,39 @@ UPGRADE FROM 2.x to 3.0
10401040 }
10411041 ` ` `
10421042
1043+ * The `AbstractVoter::isGranted()` method have been replaced by `Voter::voteOnAttribute()`.
1044+
1045+ Before :
1046+
1047+ ` ` ` php
1048+ class MyVoter extends AbstractVoter
1049+ {
1050+ protected function isGranted($attribute, $object, $user = null)
1051+ {
1052+ return 'EDIT' === $attribute && $user === $object->getAuthor();
1053+ }
1054+
1055+ // ...
1056+ }
1057+ ` ` `
1058+
1059+ After :
1060+
1061+ ` ` ` php
1062+ class MyVoter extends Voter
1063+ {
1064+ protected function voteOnAttribute($attribute, $object, TokenInterface $token)
1065+ {
1066+ return 'EDIT' === $attribute && $token->getUser() === $object->getAuthor();
1067+ }
1068+
1069+ // ...
1070+ }
1071+ ` ` `
1072+
1073+ * The `supportsAttribute()` and `supportsClass()` methods of classes `AuthenticatedVoter`, `ExpressionVoter`
1074+ and `RoleVoter` have been removed.
1075+
10431076 * The `intention` option was renamed to `csrf_token_id` for all the authentication listeners.
10441077
10451078 * The `csrf_provider` option was renamed to `csrf_token_generator` for all the authentication listeners.
You can’t perform that action at this time.
0 31F3 commit comments