refactored permissions for simpler customizations (#808)

This commit is contained in:
Kevin Papst
2019-05-25 17:23:15 +02:00
committed by GitHub
parent d18019159b
commit ebff4a765a
24 changed files with 299 additions and 161 deletions

View File

@@ -11,10 +11,6 @@ namespace App\Controller;
use App\Constants;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route;
/**
@@ -43,11 +39,6 @@ class AboutController extends AbstractController
* @return \Symfony\Component\HttpFoundation\Response
*/
public function debugAction()
{
return $this->getAboutView();
}
protected function getAboutView(array $additional = [])
{
$phpInfo = $this->getPhpInfo();
unset($phpInfo[0]);
@@ -89,8 +80,7 @@ class AboutController extends AbstractController
],
'info' => $phpInfo,
'settings' => $settings,
],
$additional
]
));
}
@@ -119,28 +109,6 @@ class AboutController extends AbstractController
]);
}
/**
* @Route(path="/flush-cache", name="system_flush_cache", methods={"GET"})
*
* @Security("is_granted('system_actions')")
*/
public function rebuildContainer(KernelInterface $kernel)
{
$application = new Application($kernel);
$application->setAutoExit(false);
$input = new ArrayInput([
'command' => 'cache:clear',
'--env' => $kernel->getEnvironment(),
'-n',
]);
$output = new BufferedOutput();
$application->run($input, $output);
return $this->getAboutView(['content_action' => $output->fetch()]);
}
/**
* @author https://php.net/manual/en/function.phpinfo.php#117961
* @return array