<?php

namespace App\Controllers;

require_once BASE_PATH . '/app/helpers/permissions.php';

use App\Core\Database;

class AdminSecurityController
{
public function index()
{
    requirePermission(
        'roles.manage',
        'view'
    );

    $db =
        \App\Core\Database::getInstance();

    $logs =
        $db->query("
            SELECT *
            FROM permission_audit_log
            ORDER BY id DESC
            LIMIT 200
        ")
        ->fetchAll(\PDO::FETCH_ASSOC);

    ob_start();

    require BASE_PATH .
        '/app/views/admin/security/index.php';

    $content =
        ob_get_clean();

    require BASE_PATH .
        '/app/views/layouts/admin_layout.php';
}
}
