webTemplate/src/lib/routes.js

29 lines
715 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { LayoutGrid, ClipboardList, FolderKanban, Wrench, Users } from "lucide-react";
// Sidebar'da görünen ve erişim denetiminde kullanılan tek kaynak.
// roles: undefined -> herkes erişebilir. Aksi halde listelenen rollere sahip
// kullanıcılar erişebilir.
export const dashboardRoutes = [
{
href: "/",
label: "Main Page",
icon: LayoutGrid,
showInSidebar: false,
},
{
href: "/person",
label: "Users",
icon: Users,
roles: ["ADMINISTRATOR"],
},
];
export function canAccessRoute(route, role) {
if (!route.roles) return true;
return route.roles.includes(role);
}
export function findRouteByPath(path) {
return dashboardRoutes.find((r) => r.href === path);
}