File: D:/HostingSpaces/SBogers10/stielman.komma.nl/vendor/komma/kms/src/OPcache/OPcachePolicy.php
<?php
namespace Komma\KMS\OPcache;
use Illuminate\Support\Facades\Gate;
use Komma\KMS\Users\Models\KmsUserRole;
use Komma\KMS\Users\Models\KmsUser;
class OPcachePolicy
{
/**
* Register the policy to the laravel system
*/
public static function register() {
Gate::define('clearOPcache', self::class.'@clearOPcache');
}
/**
* Determine if a user may clear the OPcache.
*
* @param KmsUser|null $user
* @return bool
*/
public function clearOPcache(?KmsUser $user): bool
{
return $user->isAtLeast(KmsUserRole::SuperAdmin);
}
}