<?php

require_once
'/var/www/html/easychair/public/index.php';

use App\Core\Database;

echo "Seeding permissions...\n";

$db = Database::getInstance();

$permissions = [

    'users.manage',
    'roles.manage',
    'reviewer.assign',
    'review.submit',
    'decision.make',
    'submission.workflow',
    'submission.reviews'

];

foreach ($permissions as $p) {

    $stmt = $db->prepare("
        INSERT IGNORE INTO permissions
        (
            code,
            created_at
        )
        VALUES
        (?, NOW())
    ");

    $stmt->execute([$p]);

    echo "Inserted: $p\n";
}

echo "\nDone.\n";
