feat: permissions, a console for everyone who manages something, and catalog management
Phase 1 of docs/console.md: permissions as resource:action strings in role bundles at a scope; the console for anyone controlling a catalog, product or room, with a tagged audit log scoped by permission and filters; catalog settings (rating ceiling, upload policy), key rotation, operators, membership (approval, invitations, bans) enforced when getting and wearing products, delisting, suspension, and the catalogs' changes feed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
76497c9b41
commit
370ae0646a
29 files changed
+5657
-181
No files matched your search
@@ -19,7 +19,7 @@ export async function generateMetadata({ params }: { params: Promise<{ id: strin
|
||||
export default async function ProductPage({ params }: { params: Promise<{ id: string }> }) {
|
||||
const { id } = await params;
|
||||
const [me, data] = await Promise.all([getMe(), loadProduct(id)]);
|
||||
const { product, revisions, inLibrary, stayOn, mine } = data;
|
||||
const { product, revisions, inLibrary, stayOn, mine, available, catalogs } = data;
|
||||
const using = inLibrary ? inUse(revisions, stayOn ?? product.latest) : undefined;
|
||||
|
||||
return (
|
||||
@@ -62,10 +62,24 @@ export default async function ProductPage({ params }: { params: Promise<{ id: st
|
||||
Remove
|
||||
</SubmitButton>
|
||||
</>
|
||||
) : (
|
||||
) : available ? (
|
||||
<SubmitButton name="intent" value="get" pendingLabel="Getting…">
|
||||
Get
|
||||
</SubmitButton>
|
||||
) : (
|
||||
<span className="text-sm text-muted-foreground">
|
||||
Members only. Join{" "}
|
||||
{catalogs.map((c, i) => (
|
||||
<span key={c.id}>
|
||||
{i > 0 && (i === catalogs.length - 1 ? " or " : ", ")}
|
||||
<Link href={`/catalogs/${c.id}`} className="font-medium text-foreground underline-offset-4 hover:underline">
|
||||
{c.name}
|
||||
</Link>
|
||||
{c.joined === "requested" && " (asked)"}
|
||||
</span>
|
||||
))}{" "}
|
||||
to get it.
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</ActionForm>
|
||||
|
||||
Reference in new issue
Block a user