missing permission check in portal

This commit is contained in:
Denis Duliçi 2020-06-24 12:18:38 +03:00
parent 46cd0ab732
commit aa3e2e80b8

View File

@ -14,12 +14,17 @@ class AddPortalItems
*/ */
public function handle(Event $event) public function handle(Event $event)
{ {
$user = user();
$menu = $event->menu; $menu = $event->menu;
$menu->route('portal.dashboard', trans_choice('general.dashboards', 1), [], 100, ['icon' => 'fa fa-tachometer-alt']); $menu->route('portal.dashboard', trans_choice('general.dashboards', 1), [], 100, ['icon' => 'fa fa-tachometer-alt']);
$menu->route('portal.invoices.index', trans_choice('general.invoices', 2), [], 200, ['icon' => 'fa fa-file-signature']); if ($user->can('read-portal-invoices')) {
$menu->route('portal.invoices.index', trans_choice('general.invoices', 2), [], 200, ['icon' => 'fa fa-file-signature']);
}
$menu->route('portal.payments.index', trans_choice('general.payments', 2), [], 300, ['icon' => 'fa fa-money-bill']); if ($user->can('read-portal-payments')) {
$menu->route('portal.payments.index', trans_choice('general.payments', 2), [], 300, ['icon' => 'fa fa-money-bill']);
}
} }
} }