I have the Spatie Permissions package installed, and I have created policies to restrict access for my models using this package.
However, I'm struggling a bit on the creating a gate to enable certain roles such as 'Admin' and 'Content Editor' to access the Nova dashboard?
I assume it would involve the gate() function in the NovaServiceProvider. Here is what i tried.
protected function gate()
{
Gate::define('viewNova', function ($user) {
if ($user->hasRole('Admin') || $user->hasRole('Content Editor'))
{
return true;
}
});
}