feature: set role previledge access
This commit is contained in:
@@ -9,6 +9,12 @@ class UsersTable {
|
||||
}
|
||||
|
||||
initTableUsers() {
|
||||
let tableContainer = document.getElementById(
|
||||
"table-users"
|
||||
);
|
||||
|
||||
tableContainer.innerHTML = "";
|
||||
let canUpdate = tableContainer.getAttribute("data-updater") === "1";
|
||||
new Grid({
|
||||
columns: [
|
||||
"ID",
|
||||
@@ -20,14 +26,18 @@ class UsersTable {
|
||||
"Roles",
|
||||
{
|
||||
name: "Action",
|
||||
formatter: (cell) =>
|
||||
gridjs.html(`
|
||||
formatter: (cell) =>{
|
||||
if (!canUpdate) {
|
||||
return gridjs.html(`<span class="text-muted">No Privilege</span>`);
|
||||
}
|
||||
return gridjs.html(`
|
||||
<div class="d-flex justify-content-center">
|
||||
<a href="/master/users/${cell}/edit" class="btn btn-yellow btn-sm d-inline-flex align-items-center justify-content-center">
|
||||
<i class='bx bx-edit'></i>
|
||||
</a>
|
||||
</div>
|
||||
`),
|
||||
`);
|
||||
},
|
||||
},
|
||||
],
|
||||
pagination: {
|
||||
|
||||
Reference in New Issue
Block a user