import { redirect } from "next/navigation";
import { auth } from "@/auth";
import { can } from "@/lib/rbac";
import { UsersView } from "@/components/users-view";

export default async function UsersPage() {
  const session = await auth();
  if (!can(session?.user?.role, "users:manage")) redirect("/dashboard");
  return <UsersView />;
}
