34 lines
631 B
PHP
34 lines
631 B
PHP
<?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());
|
|
}
|
|
}
|