8000 document method name changes in Voter class by xabbuh · Pull Request #18927 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

document method name changes in Voter class #18927

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

Merged
merged 1 commit into from
Jun 1, 2016
Merged
Changes from all commits
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
33 changes: 33 additions & 0 deletions UPGRADE-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,39 @@ UPGRADE FROM 2.x to 3.0
}
```

* The `Ab 8E41 stractVoter::isGranted()` method has been replaced by `Voter::voteOnAttribute()`.

Before:

```php
class MyVoter extends AbstractVoter
{
protected function isGranted($attribute, $object, $user = null)
{
return 'EDIT' === $attribute && $user === $object->getAuthor();
}

// ...
}
```

After:

```php
class MyVoter extends Voter
{
protected function voteOnAttribute($attribute, $object, TokenInterface $token)
{
return 'EDIT' === $attribute && $token->getUser() === $object->getAuthor();
}

// ...
}
```

* The `supportsAttribute()` and `supportsClass()` methods of the `AuthenticatedVoter`, `ExpressionVoter`,
and `RoleVoter` classes have been removed.

* The `intention` option was renamed to `csrf_token_id` for all the authentication listeners.

* The `csrf_provider` option was renamed to `csrf_token_generator` for all the authentication listeners.
Expand Down
0