minor #34594 [Security] Changed has_role to is_granted for expression in upgrade 5.0 (linaori)

This PR was merged into the 5.0 branch.

Discussion
----------

[Security] Changed has_role to is_granted for expression in upgrade 5.0

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | ~ <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | ~ <!-- required for new features -->

Changes for #34593 that can only be applied on 5.0+

Commits
-------

2f1336e79f has_roles should be is_granted in security upgrade file
This commit is contained in:
Fabien Potencier 2019-11-26 06:02:29 +01:00
commit 6856c563df

View File

@ -15,7 +15,7 @@ CHANGELOG
**After**
```php
if ($this->authorizationChecker->isGranted(new Expression("has_role('ROLE_USER') or has_role('ROLE_ADMIN')"))) {}
if ($this->authorizationChecker->isGranted(new Expression("is_granted('ROLE_USER') or is_granted('ROLE_ADMIN')"))) {}
// or:
if ($this->authorizationChecker->isGranted('ROLE_USER')
|| $this->authorizationChecker->isGranted('ROLE_ADMIN')