<?php
require __DIR__ . '/../vendor/autoload.php';
$app = require __DIR__ . '/../bootstrap/app.php';
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();

$user = App\Models\User::where('email', 'superadmin@example.com')->first();
if (! $user) {
    echo "superadmin user not found\n";
    exit;
}

echo 'roles: ' . $user->getRoleNames()->implode(', ') . PHP_EOL;
echo 'direct+role permissions count: ' . $user->getAllPermissions()->count() . PHP_EOL;
echo 'has view categories: ' . ($user->can('view categories') ? 'yes' : 'no') . PHP_EOL;
