wip
This commit is contained in:
@@ -56,6 +56,7 @@ class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
// General permissions...
|
||||
Gate::define('isMe', fn ($user) => $user->isMe());
|
||||
Gate::define('isSuperAdmin', fn ($user) => $user->isSuperAdmin());
|
||||
Gate::define('isAdmin', fn ($user) => $user->isAdmin());
|
||||
Gate::define('systemUser', fn ($user) => $user->isSystemUser());
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
|
||||
->onSwitchLocale(NovaRepo::localeSwitcherSave()),
|
||||
|
||||
BackupTool::make()
|
||||
->canSee(NovaRepo::isAdmin()),
|
||||
->canSee(NovaRepo::isSuperAdmin()),
|
||||
|
||||
LogsTool::make()
|
||||
->canSee(NovaRepo::isMe())
|
||||
|
||||
@@ -86,7 +86,15 @@ class NovaRepo
|
||||
/**
|
||||
* Check if user is admin
|
||||
*/
|
||||
public function isAdmin(): Closure
|
||||
public static function isSuperAdmin(): Closure
|
||||
{
|
||||
return fn () => Gate::allows('isSuperAdmin', auth()->user());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user is admin
|
||||
*/
|
||||
public static function isAdmin(): Closure
|
||||
{
|
||||
return fn () => Gate::allows('isAdmin', auth()->user());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user