Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Commit

Permalink
Filter list of available authorized dashboards
Browse files Browse the repository at this point in the history
This commit filters the dashboard list so that the navigation will not show Dashboards the user is not authorized to see (via the authorize() method on the dashboards. This allows for different sets of dashboard depending on authorization policies.
  • Loading branch information
Kenneth Keegan authored Sep 5, 2018
1 parent 1c8e3cb commit 1505c84
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/DashboardNova.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ public static function copyDefaultDashboardCards()
*/
public static function availableDashboards(Request $request)
{
return collect(static::$dashboards)->all();
return collect(static::$dashboards)
->filter
->authorize($request)
->all();
}

/**
Expand Down

0 comments on commit 1505c84

Please sign in to comment.