How can I create a policy/gate to restrict users from accessing Nova tools (e.g. Spatie Nova Backup Tool)?
I had the same issue and I resolved it like this.
NovaServiceProvider
Add a gate/check in the tools()
method
public function tools()
{
if (Auth::user()->hasAnyRole(['admin'])) {
return [new Foo, new Bar];
}
return [];
}
This will solve the issue but I am not sure wether this is the Nova
way of doing it or not.