Skip to content

Commit 973adcc

Browse files
authored
Display permissions on category and map topic pages (#49291)
1 parent 4cd4278 commit 973adcc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/frame/components/context/TocLandingContext.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export type TocLandingContextT = {
1616
title: string
1717
intro: string
1818
productCallout: string
19+
permissions: string
1920
tocItems: Array<TocItem>
2021
variant?: 'compact' | 'expanded'
2122
featuredLinks: Record<string, Array<FeaturedLink>>
@@ -39,12 +40,12 @@ export const getTocLandingContextFromRequest = (req: any): TocLandingContextT =>
3940
return {
4041
title: req.context.page.title,
4142
productCallout: req.context.page.product || '',
43+
permissions: req.context.page.permissions || '',
4244
intro: req.context.page.intro,
4345
tocItems: (req.context.genericTocFlat || req.context.genericTocNested || []).map((obj: any) =>
4446
pick(obj, ['fullPath', 'title', 'intro', 'childTocItems']),
4547
),
4648
variant: req.context.genericTocFlat ? 'expanded' : 'compact',
47-
4849
featuredLinks: getFeaturedLinksFromReq(req),
4950
renderedPage: req.context.renderedPage,
5051
currentLearningTrack: req.context.currentLearningTrack,

src/landings/components/TocLanding.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const TocLanding = () => {
2727
featuredLinks,
2828
renderedPage,
2929
currentLearningTrack,
30+
permissions,
3031
} = useTocLandingContext()
3132
const { t } = useTranslation('toc')
3233

@@ -46,7 +47,7 @@ export const TocLanding = () => {
4647

4748
{intro && <Lead data-search="lead">{intro}</Lead>}
4849

49-
<PermissionsStatement product={productCallout} />
50+
<PermissionsStatement product={productCallout} permissions={permissions} />
5051

5152
<div className="border-bottom border-xl-0 pb-4 mb-5 pb-xl-2 mb-xl-2" />
5253

0 commit comments

Comments
 (0)