Limit client asset library to app-generated folders only.
Agency still sees the full Drive tree and portal uploads; clients only see Pipeline-creatividades / calendarios / brandbook-style paths. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import React from 'react';
|
||||
import { createClient } from '@/lib/supabase/server';
|
||||
import { redirect } from 'next/navigation';
|
||||
import { resolveActiveTenant } from '@/lib/tenant-context';
|
||||
import { isAgencyRole, userRole } from '@/lib/agency';
|
||||
import AssetsLibrary from '@/components/AssetsLibrary';
|
||||
import { EmptyState, PageHeader } from '@/components/ui';
|
||||
|
||||
@@ -15,6 +16,7 @@ export default async function ActivosPage() {
|
||||
if (!user) redirect('/login');
|
||||
|
||||
const ctx = await resolveActiveTenant(user);
|
||||
const agency = isAgencyRole(userRole(user));
|
||||
|
||||
if (ctx.portfolioWide) {
|
||||
return (
|
||||
@@ -32,5 +34,5 @@ export default async function ActivosPage() {
|
||||
);
|
||||
}
|
||||
|
||||
return <AssetsLibrary tenantLabel={ctx.label} />;
|
||||
return <AssetsLibrary tenantLabel={ctx.label} isAgency={agency} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user