Added Roles and Permissions. Some minor UI fixes

This commit is contained in:
2026-02-18 13:12:55 +02:00
parent f54cdd525d
commit dbd15c00f8
31 changed files with 1825 additions and 331 deletions

View File

@@ -17,8 +17,8 @@ export default function UserList() {
const [deleteTarget, setDeleteTarget] = useState(null);
const [hoveredRow, setHoveredRow] = useState(null);
const navigate = useNavigate();
const { hasRole } = useAuth();
const canEdit = hasRole("superadmin", "user_manager");
const { hasPermission } = useAuth();
const canEdit = hasPermission("app_users", "edit");
const fetchUsers = async () => {
setLoading(true);
@@ -57,7 +57,7 @@ export default function UserList() {
return (
<div>
<div className="flex items-center justify-between mb-6">
<h1 className="text-2xl font-bold" style={{ color: "var(--text-heading)" }}>Users</h1>
<h1 className="text-2xl font-bold" style={{ color: "var(--text-heading)" }}>App Users</h1>
{canEdit && (
<button
onClick={() => navigate("/users/new")}