feat: update permissions

This commit is contained in:
ivannoskov
2026-02-10 17:41:11 +03:00
parent e1117e46c8
commit f0574db79f
7 changed files with 335 additions and 140 deletions

View File

@@ -7,10 +7,40 @@
import { DashboardHeader } from "@/components/layout/dashboard-header";
import { useParams } from "next/navigation";
import { Card, CardContent } from "@/components/ui/card";
import { Lock } from "lucide-react";
import { useWorkspace } from "@/components/providers/workspace-provider";
export default function CreativesAnalyticsPage() {
const params = useParams();
const workspaceId = params?.workspaceId as string;
const { hasAnyAnalyticsPermission } = useWorkspace();
const hasPermission = hasAnyAnalyticsPermission;
if (!hasPermission) {
return (
<>
<DashboardHeader
breadcrumbs={[
{ label: "Главная", href: `/dashboard/${workspaceId}` },
{ label: "Аналитика", href: `/dashboard/${workspaceId}/analytics` },
{ label: "По креативам" },
]}
/>
<div className="flex flex-1 flex-col gap-4 p-4 pt-0 mt-4">
<Card>
<CardContent className="flex flex-col items-center justify-center py-16">
<Lock className="h-12 w-12 text-muted-foreground mb-4" />
<h3 className="text-lg font-semibold mb-2">Доступ ограничен</h3>
<p className="text-muted-foreground text-center">
У вас нет разрешения на просмотр аналитики. Обратитесь к администратору рабочего пространства.
</p>
</CardContent>
</Card>
</div>
</>
);
}
return (
<>