quick code clean ups
This commit is contained in:
33
app/Repos/System/Nova/NovaPermissionRepo.php
Normal file
33
app/Repos/System/Nova/NovaPermissionRepo.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repos\System\Nova;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class NovaPermissionRepo
|
||||
{
|
||||
/**
|
||||
* Check if user is me
|
||||
*/
|
||||
public static function isMe(): Closure
|
||||
{
|
||||
return fn () => Gate::allows('isMe', auth()->user());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user is admin
|
||||
*/
|
||||
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