feat: แกไขสวน pages.jsx, layout.jsx

This commit is contained in:
admin
2025-09-27 16:26:22 +07:00
parent db7030883f
commit 83a8cddc82
10 changed files with 1002 additions and 238 deletions

View File

@@ -1,7 +1,8 @@
// lib/rbac.js
export function can(user, perm) {
const set = new Set(user?.permissions || []);
return set.has(perm);
}
export function inRole(user, ...roles) {
return roles.includes(user?.role);
}
}