Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 006ea45

Browse files
committed
minor #13566 [Workflow] Replace has_role by is_granted (tienvx)
This PR was submitted for the 5.0 branch but it was merged into the 4.4 branch instead. Discussion ---------- [Workflow] Replace has_role by is_granted As in changelog of security component version 5.0: ``` Removed the `has_role()` function from security expressions, use `is_granted()` instead. ``` <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- d42583d [Workflow] Replace has_role by is_granted
2 parents 687f2c6 + d42583d commit 006ea45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

workflow.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ transition. The value of this option is any valid expression created with the
546546
547547
<framework:transition name="reject">
548548
<!-- or any valid expression language with "subject" referring to the post -->
549-
<framework:guard>has_role("ROLE_ADMIN") and subject.isStatusReviewed()</framework:guard>
549+
<framework:guard>is_granted("ROLE_ADMIN") and subject.isStatusReviewed()</framework:guard>
550550
<framework:from>reviewed</framework:from>
551551
<framework:to>rejected</framework:to>
552552
</framework:transition>
@@ -581,7 +581,7 @@ transition. The value of this option is any valid expression created with the
581581
],
582582
'reject' => [
583583
// or any valid expression language with "subject" referring to the post
584-
'guard' => 'has_role("ROLE_ADMIN") and subject.isStatusReviewed()',
584+
'guard' => 'is_granted("ROLE_ADMIN") and subject.isStatusReviewed()',
585585
'from' => 'reviewed',
586586
'to' => 'rejected',
587587
],

0 commit comments

Comments
 (0)