UNPKG

@mintlify/common

Version:

Commonly shared code within Mintlify

13 lines (12 loc) 462 B
export function checkNavAccess(page, userGroups, isPreview = false, checkHidden = true) { if (isPreview) return true; if (checkHidden && page.hidden) return false; const pageGroups = Array.isArray(page.groups) && page.groups.every((pageGroup) => typeof pageGroup === 'string') ? page.groups : undefined; if (!pageGroups) return true; return pageGroups.some((pageGroup) => userGroups.has(pageGroup)); }