Skip to content

Commit 6ec2223

Browse files
committed
bug #866 Fixed the has_role() deprecation (javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Fixed the has_role() deprecation This is a deprecation introduced by the upgrade to Symfony 4.2 in #865. ``` 14x: Using the "has_role()" function in security expressions is deprecated since Symfony 4.2, use "is_granted()" instead. 2x in BlogControllerTest::testAdminNewPost from App\Tests\Controller\Admin 2x in BlogControllerTest::testAdminEditPost from App\Tests\Controller\Admin 2x in BlogControllerTest::testAdminDeletePost from App\Tests\Controller\Admin 2x in UserControllerTest::testAccessDeniedForAnonymousUsers from App\Tests\Controller 2x in UserControllerTest::testEditUser from App\Tests\Controller 2x in UserControllerTest::testChangePassword from App\Tests\Controller 1x in BlogControllerTest::testAdminBackendHomePage from App\Tests\Controller\Admin 1x in BlogControllerTest::testAdminShowPost from App\Tests\Controller\Admin ``` Commits ------- 51b5135 Fixed the has_role() deprecation
2 parents ec6bd34 + 51b5135 commit 6ec2223

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Controller/Admin/BlogController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* See http://knpbundles.com/keyword/admin
3434
*
3535
* @Route("/admin/post")
36-
* @Security("has_role('ROLE_ADMIN')")
36+
* @Security("is_granted('ROLE_ADMIN')")
3737
*
3838
* @author Ryan Weaver <[email protected]>
3939
* @author Javier Eguiluz <[email protected]>

src/Controller/UserController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* Controller used to manage current user.
2525
*
2626
* @Route("/profile")
27-
* @Security("has_role('ROLE_USER')")
27+
* @Security("is_granted('ROLE_USER')")
2828
*
2929
* @author Romain Monteil <[email protected]>
3030
*/

0 commit comments

Comments
 (0)