User roles and permission management via Admin UI (#1231)

This commit is contained in:
Kevin Papst
2019-11-10 18:53:56 +01:00
committed by GitHub
parent c6c4098759
commit af0f89774e
58 changed files with 1355 additions and 186 deletions

View File

@@ -24,7 +24,7 @@ use Symfony\Component\Routing\Annotation\Route;
* Dashboard controller for the admin area.
*
* @Route(path="/dashboard")
* @Security("is_granted('ROLE_USER')")
* @Security("is_granted('IS_AUTHENTICATED_REMEMBERED')")
*/
class DashboardController extends AbstractController
{
@@ -121,9 +121,16 @@ class DashboardController extends AbstractController
$this->eventDispatcher->dispatch($event);
$sections = $event->getSections();
$clearedSections = [];
/** @var WidgetContainerInterface $section */
foreach ($sections as $key => $section) {
if (!empty($section->getWidgets())) {
$clearedSections[] = $section;
}
}
uasort(
$sections,
$clearedSections,
function (WidgetContainerInterface $a, WidgetContainerInterface $b) {
if ($a->getOrder() == $b->getOrder()) {
return 0;
@@ -134,7 +141,7 @@ class DashboardController extends AbstractController
);
return $this->render('dashboard/index.html.twig', [
'widgets' => $sections
'widgets' => $clearedSections
]);
}
}