wip
This commit is contained in:
1 parent
382317f1ae
commit
84bcc2e517
3 files changed
+11
-2
No files matched your search
@@ -56,6 +56,7 @@ public function boot(): void
|
|||||||
{
|
{
|
||||||
// General permissions...
|
// General permissions...
|
||||||
Gate::define('isMe', fn ($user) => $user->isMe());
|
Gate::define('isMe', fn ($user) => $user->isMe());
|
||||||
|
Gate::define('isSuperAdmin', fn ($user) => $user->isSuperAdmin());
|
||||||
Gate::define('isAdmin', fn ($user) => $user->isAdmin());
|
Gate::define('isAdmin', fn ($user) => $user->isAdmin());
|
||||||
Gate::define('systemUser', fn ($user) => $user->isSystemUser());
|
Gate::define('systemUser', fn ($user) => $user->isSystemUser());
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public function tools(): array
|
|||||||
->onSwitchLocale(NovaRepo::localeSwitcherSave()),
|
->onSwitchLocale(NovaRepo::localeSwitcherSave()),
|
||||||
|
|
||||||
BackupTool::make()
|
BackupTool::make()
|
||||||
->canSee(NovaRepo::isAdmin()),
|
->canSee(NovaRepo::isSuperAdmin()),
|
||||||
|
|
||||||
LogsTool::make()
|
LogsTool::make()
|
||||||
->canSee(NovaRepo::isMe())
|
->canSee(NovaRepo::isMe())
|
||||||
|
|||||||
@@ -86,7 +86,15 @@ public static function isMe(): Closure
|
|||||||
/**
|
/**
|
||||||
* Check if user is admin
|
* 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());
|
return fn () => Gate::allows('isAdmin', auth()->user());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user