feature: set role previledge access

This commit is contained in:
2025-03-07 14:39:46 +07:00
parent dceb46ab86
commit fbfa2a37bb
39 changed files with 739 additions and 223 deletions

View File

@@ -9,6 +9,11 @@ class PbgTasks {
}
initTableRequestAssignment() {
let tableContainer = document.getElementById("table-pbg-tasks");
// Pastikan kontainer kosong sebelum merender ulang Grid.js
tableContainer.innerHTML = "";
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
new Grid({
columns: [
"ID",
@@ -24,13 +29,24 @@ class PbgTasks {
{
name: "Action",
formatter: function (cell) {
let tableContainer = document.getElementById("table-pbg-tasks");
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
if (!canUpdate) {
return gridjs.html(`
<span class="text-muted">No Privilege</span>
`);
}
return gridjs.html(`
<div class="d-flex justify-content-center align-items-center gap-2">
<a href="/pbg-task/${cell}" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">Detail</a
<a href="/pbg-task/${cell}" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
Detail
</a>
</div>
`);
},
},
}
],
search: {
server: {