The catalog manager (with auto-category wizard) now lives inside the Studio navigation for teams that manage furniture inline. The button is gated on CATALOG_EDIT; only users with that permission see the launcher. - Split server/client Studio layout to derive permissions server-side - Add optional triggerLabel prop to CatalogManagerDialog for custom labels - Wire the Catalog manager button in the Studio nav right cluster - Keep existing /admin/catalog entry points unchanged
22 lines
493 B
TypeScript
22 lines
493 B
TypeScript
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
|
|
import { StudioLayoutClient } from "./studio-layout-client";
|
|
|
|
export default async function StudioLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const { session, permissions } = await getAdminContext();
|
|
const canEditCatalog = canAccess(
|
|
permissions,
|
|
PERMS.CATALOG_EDIT,
|
|
session.user.rank,
|
|
);
|
|
|
|
return (
|
|
<StudioLayoutClient canEditCatalog={canEditCatalog}>
|
|
{children}
|
|
</StudioLayoutClient>
|
|
);
|
|
}
|