Updated security expressions #148 (#166)

* replace has_role() with is_granted()
* added basic integration test classes for main controller
* added basic integration test classes for admin controller
This commit is contained in:
Kevin Papst
2018-06-19 22:08:44 +02:00
committed by GitHub
parent 856e7ccaeb
commit 75a6bf3ef6
24 changed files with 465 additions and 22 deletions

View File

@@ -18,8 +18,7 @@ use App\Repository\ActivityRepository;
/**
* Controller used to manage activity contents in the public part of the site.
*
* @Route("/activity")
* @Security("has_role('ROLE_USER')")
* @Security("is_granted('ROLE_USER')")
*/
class ActivityController extends Controller
{

View File

@@ -25,7 +25,7 @@ use App\Repository\Query\ActivityQuery;
* Controller used to manage activities in the admin part of the site.
*
* @Route("/admin/activity")
* @Security("has_role('ROLE_ADMIN')")
* @Security("is_granted('ROLE_ADMIN')")
* @Security("is_granted('IS_AUTHENTICATED_FULLY')")
*/
class ActivityController extends AbstractController

View File

@@ -24,7 +24,7 @@ use App\Repository\Query\CustomerQuery;
* Controller used to manage activities in the admin part of the site.
*
* @Route("/admin/customer")
* @Security("has_role('ROLE_ADMIN')")
* @Security("is_granted('ROLE_ADMIN')")
* @Security("is_granted('IS_AUTHENTICATED_FULLY')")
*/
class CustomerController extends AbstractController

View File

@@ -26,7 +26,7 @@ use App\Repository\Query\ProjectQuery;
* Controller used to manage projects in the admin part of the site.
*
* @Route("/admin/project")
* @Security("has_role('ROLE_ADMIN')")
* @Security("is_granted('ROLE_ADMIN')")
* @Security("is_granted('IS_AUTHENTICATED_FULLY')")
*/
class ProjectController extends AbstractController

View File

@@ -25,7 +25,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
* Controller used for manage timesheet entries in the admin part of the site.
*
* @Route("/team/timesheet")
* @Security("has_role('ROLE_TEAMLEAD')")
* @Security("is_granted('ROLE_TEAMLEAD')")
* @Security("is_granted('IS_AUTHENTICATED_FULLY')")
*/
class TimesheetController extends AbstractController

View File

@@ -24,7 +24,7 @@ use Symfony\Component\HttpFoundation\Request;
* Controller used to manage users in the admin part of the site.
*
* @Route("/admin/user")
* @Security("has_role('ROLE_SUPER_ADMIN')")
* @Security("is_granted('ROLE_SUPER_ADMIN')")
* @Security("is_granted('IS_AUTHENTICATED_FULLY')")
*/
class UserController extends AbstractController

View File

@@ -24,7 +24,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
* Dashboard controller for the admin area.
*
* @Route("/dashboard")
* @Security("has_role('ROLE_USER')")
* @Security("is_granted('ROLE_USER')")
*/
class DashboardController extends Controller
{

View File

@@ -19,7 +19,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
* This controller can render the markdown documentation from /var/docs/
*
* @Route("/help")
* @Security("has_role('ROLE_USER')")
* @Security("is_granted('ROLE_USER')")
*/
class HelpController extends Controller
{

View File

@@ -27,7 +27,7 @@ use Symfony\Component\HttpFoundation\Request;
* Controller used to manage invoices.
*
* @Route("/invoice")
* @Security("has_role('ROLE_TEAMLEAD')")
* @Security("is_granted('ROLE_TEAMLEAD')")
*/
class InvoiceController extends AbstractController
{

View File

@@ -27,7 +27,7 @@ use Symfony\Component\HttpFoundation\Request;
* User profile controller
*
* @Route("/profile")
* @Security("has_role('ROLE_USER')")
* @Security("is_granted('ROLE_USER')")
*/
class ProfileController extends AbstractController
{

View File

@@ -15,7 +15,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
/**
* Sidebar controller
*
* @Security("has_role('ROLE_USER')")
* @Security("is_granted('ROLE_USER')")
*/
class SidebarController extends AbstractController
{

View File

@@ -25,7 +25,7 @@ use Symfony\Component\HttpFoundation\Request;
* Controller used to manage timesheet contents in the public part of the site.
*
* @Route("/timesheet")
* @Security("has_role('ROLE_USER')")
* @Security("is_granted('ROLE_USER')")
*/
class TimesheetController extends AbstractController
{