<?php
require_once 'app/helpers/auth.php';
require_once 'app/helpers/rbac.php';
requireLogin();

if (!can('user.manage')) {
    echo "<div class='alert alert-danger m-4'>Access denied</div>";
    exit;
}

$page_js = 'permissions.js';

include 'views/layouts/header.php';
include 'views/layouts/sidebar.php';
?>

<main class="main-content">
<?php include 'views/layouts/topbar.php'; ?>

<div class="container-fluid p-4">

    <h4 class="mb-3">Permission Matrix</h4>

    <div class="card">
        <div class="card-body table-responsive">
            <table class="table table-bordered" id="permissionTable">
                <thead id="permHead"></thead>
                <tbody id="permBody"></tbody>
            </table>
        </div>
    </div>

</div>

</main>

<?php include 'views/layouts/footer.php'; ?>