feat: update permissions
This commit is contained in:
@@ -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 (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user