Skip to content

Commit 985cdb9

Browse files
committed
feature #873 Migrate from @Security to @IsGranted (ker0x)
This PR was merged into the master branch. Discussion ---------- Migrate from @Security to @IsGranted As suggested by @stof and requested with #870 ! Commits ------- 478068e Migrate from @Security to @IsGranted
2 parents fcd4661 + 478068e commit 985cdb9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/Controller/Admin/BlogController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use App\Repository\PostRepository;
1717
use App\Utils\Slugger;
1818
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
19-
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
2019
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
2120
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
2221
use Symfony\Component\HttpFoundation\Request;
@@ -33,7 +32,7 @@
3332
* See http://knpbundles.com/keyword/admin
3433
*
3534
* @Route("/admin/post")
36-
* @Security("is_granted('ROLE_ADMIN')")
35+
* @IsGranted("ROLE_ADMIN")
3736
*
3837
* @author Ryan Weaver <[email protected]>
3938
* @author Javier Eguiluz <[email protected]>

src/Controller/UserController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use App\Form\Type\ChangePasswordType;
1515
use App\Form\UserType;
16-
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
16+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
1717
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
1818
use Symfony\Component\HttpFoundation\Request;
1919
use Symfony\Component\HttpFoundation\Response;
@@ -24,7 +24,7 @@
2424
* Controller used to manage current user.
2525
*
2626
* @Route("/profile")
27-
* @Security("is_granted('ROLE_USER')")
27+
* @IsGranted("ROLE_USER")
2828
*
2929
* @author Romain Monteil <[email protected]>
3030
*/

0 commit comments

Comments
 (0)