diff --git a/app/src/app/app/documents/_assets/alliance_manifest.png b/app/src/app/app/documents/_assets/alliance_manifest.png new file mode 100644 index 00000000..e07c8205 Binary files /dev/null and b/app/src/app/app/documents/_assets/alliance_manifest.png differ diff --git a/app/src/app/app/documents/_assets/introduction_compendium.png b/app/src/app/app/documents/_assets/introduction_compendium.png index c3293919..26079d04 100644 Binary files a/app/src/app/app/documents/_assets/introduction_compendium.png and b/app/src/app/app/documents/_assets/introduction_compendium.png differ diff --git a/app/src/app/app/documents/page.tsx b/app/src/app/app/documents/page.tsx index a1011f3c..79cd1de6 100644 --- a/app/src/app/app/documents/page.tsx +++ b/app/src/app/app/documents/page.tsx @@ -3,6 +3,8 @@ import { Hero } from "@/common/components/Hero"; import { type Metadata } from "next"; import Image from "next/image"; import Link from "next/link"; +import { redirect } from "next/navigation"; +import allianceManifest from "./_assets/alliance_manifest.png"; import introductionCompendium from "./_assets/introduction_compendium.png"; export const metadata: Metadata = { @@ -11,7 +13,14 @@ export const metadata: Metadata = { export default async function Page() { const authentication = await authenticatePage("/app/documents"); - await authentication.authorizePage("documentIntroductionCompendium", "read"); + if ( + !(await authentication.authorize( + "documentIntroductionCompendium", + "read", + )) && + !(await authentication.authorize("documentAllianceManifest", "read")) + ) + redirect("/app/forbidden"); return (
@@ -20,17 +29,39 @@ export default async function Page() {
- - Einführungskompendium - + {(await authentication.authorize( + "documentIntroductionCompendium", + "read", + )) && ( + + Einführungskompendium + + )} + + {(await authentication.authorize( + "documentAllianceManifest", + "read", + )) && ( + + Alliance Manifest + + )}
); diff --git a/app/src/app/app/roles/_components/tabs/DocumentsTab.tsx b/app/src/app/app/roles/_components/tabs/DocumentsTab.tsx index 853442e0..053ccecb 100644 --- a/app/src/app/app/roles/_components/tabs/DocumentsTab.tsx +++ b/app/src/app/app/roles/_components/tabs/DocumentsTab.tsx @@ -24,6 +24,15 @@ export const DocumentsTab = () => { + +
+
+

Alliance Manifest

+ {/*

*/} +
+ + +
); }; diff --git a/app/src/auth/PermissionSet.tsx b/app/src/auth/PermissionSet.tsx index e8c76706..7fb7a9b9 100644 --- a/app/src/auth/PermissionSet.tsx +++ b/app/src/auth/PermissionSet.tsx @@ -23,6 +23,7 @@ export type PermissionSet = { | "note" | "eventFleet" | "documentIntroductionCompendium" + | "documentAllianceManifest" | "algolia" | "career"; // TODO: Use ENUM (https://www.prisma.io/docs/concepts/components/prisma-schema/data-model#defining-enums) diff --git a/app/src/common/components/Sidebar/DesktopSidebar.tsx b/app/src/common/components/Sidebar/DesktopSidebar.tsx index 58bd53e7..47804bf7 100644 --- a/app/src/common/components/Sidebar/DesktopSidebar.tsx +++ b/app/src/common/components/Sidebar/DesktopSidebar.tsx @@ -21,10 +21,11 @@ export const DesktopSidebar = async () => { const showOperations = (await dedupedGetUnleashFlag("EnableOperations")) && (await authentication.authorize("operation", "manage")); - const showDocuments = await authentication.authorize( - "documentIntroductionCompendium", - "read", - ); + const showDocuments = + (await authentication.authorize( + "documentIntroductionCompendium", + "read", + )) || (await authentication.authorize("documentAllianceManifest", "read")); const showShipManage = await authentication.authorize("ship", "manage"); const showOrgFleetRead = await authentication.authorize("orgFleet", "read"); const showCitizenRead = await authentication.authorize("citizen", "read"); diff --git a/app/src/common/components/Sidebar/MobileActionBar.tsx b/app/src/common/components/Sidebar/MobileActionBar.tsx index f778b232..e7ddc430 100644 --- a/app/src/common/components/Sidebar/MobileActionBar.tsx +++ b/app/src/common/components/Sidebar/MobileActionBar.tsx @@ -26,10 +26,11 @@ export const MobileActionBar = async ({ className }: Props) => { const showOperations = (await dedupedGetUnleashFlag("EnableOperations")) && (await authentication.authorize("operation", "manage")); - const showDocuments = await authentication.authorize( - "documentIntroductionCompendium", - "read", - ); + const showDocuments = + (await authentication.authorize( + "documentIntroductionCompendium", + "read", + )) || (await authentication.authorize("documentAllianceManifest", "read")); const showCareerRead = await authentication.authorize("career", "read"); return (