8000 minor #34594 [Security] Changed has_role to is_granted for expression… · symfony/symfony@6856c56 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6856c56

Browse files
committed
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 ------- 2f1336e has_roles should be is_granted in security upgrade file
2 parents 395558c + 2f1336e commit 6856c56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Security/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ CHANGELOG
1515

1616
**After**
1717
```php
18-
if ($this->authorizationChecker->isGranted(new Expression("has_role('ROLE_USER') or has_role('ROLE_ADMIN')"))) {}
18+
if ($this->authorizationChecker->isGranted(new Expression("is_granted('ROLE_USER') or is_granted('ROLE_ADMIN')"))) {}
1919
// or:
2020
if ($this->authorizationChecker->isGranted('ROLE_USER')
2121
|| $this->authorizationChecker->isGranted('ROLE_ADMIN')

0 commit comments

Comments
 (0)
0