@ -6,8 +6,12 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
use JMS\DiExtraBundle\Annotation as DI;
use KekRozsak\FrontBundle\Entity\Group;
use KekRozsak\SecurityBundle\Entity\User;
/**
* @Route("/admin")
*/
@ -26,9 +30,12 @@ class DefaultController extends Controller
*/
public function manageRegsAction()
{
if (!$this->$securityContext->isGranted('ROLE_ADMIN')) {
$objectIdentity = new ObjectIdentity(User::ACL_OID, 'KekRozsak\\SecurityBundle\\Entity\\User');
if (!$this->securityContext->isGranted('OWNER', $objectIdentity)) {
throw new AccessDeniedException('Ehhez a művelethez nincs jogosultságod.');
}
$users = $this->getDoctrine()->getEntityManager()->createQuery('SELECT u FROM KekRozsakSecurityBundle:User u WHERE u.acceptedBy IS NULL')->getResult();
$request = $this->getRequest();
@ -59,9 +66,10 @@ class DefaultController extends Controller