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:
commit
6856c563df
@ -15,7 +15,7 @@ CHANGELOG
|
|||||||
|
|
||||||
**After**
|
**After**
|
||||||
```php
|
```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:
|
// or:
|
||||||
if ($this->authorizationChecker->isGranted('ROLE_USER')
|
if ($this->authorizationChecker->isGranted('ROLE_USER')
|
||||||
|| $this->authorizationChecker->isGranted('ROLE_ADMIN')
|
|| $this->authorizationChecker->isGranted('ROLE_ADMIN')
|
||||||
|
Reference in New Issue
Block a user