<?php
namespace AppBundle\Listener;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Topxia\Service\Common\ServiceKernel;
class PermissionKernelResponseListener
{
private $container;
public function __construct($container)
{
$this->container = $container;
}
public function onKernelResponse(ResponseEvent $event)
{
if (HttpKernelInterface::MAIN_REQUEST != $event->getRequestType()) {
return;
}
ServiceKernel::instance()->getCurrentUser()->setPermissions(null);
}
}