From db41e9dabb71e1f700ff4e2519a2dfa3c43fe899 Mon Sep 17 00:00:00 2001 From: goodmice Date: Wed, 15 Jun 2022 12:45:23 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D1=81=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=B0=D0=BC=D0=B8=20=D0=BA=D0=B0=D1=82=D0=B5?= =?UTF-8?q?=D0=B3=D0=BE=D1=80=D0=B8=D0=B9=20=D0=B4=D0=BE=D0=BA=D1=83=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Documents/index.jsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/pages/Documents/index.jsx b/src/pages/Documents/index.jsx index e65b331..d3882fb 100755 --- a/src/pages/Documents/index.jsx +++ b/src/pages/Documents/index.jsx @@ -5,7 +5,7 @@ import { Layout } from 'antd' import { RootPathContext, useRootPath } from '@asb/context' import { PrivateMenu } from '@components/Private' -import { getTabname, wrapPrivateComponent, NoAccessComponent } from '@utils' +import { getTabname, wrapPrivateComponent, NoAccessComponent, hasPermission } from '@utils' import DocumentsTemplate from './DocumentsTemplate' @@ -31,27 +31,28 @@ const MenuDocuments = memo(() => { const root = useRootPath() const rootPath = useMemo(() => `${root}/document`, [root]) + const categories = useMemo(() => documentCategories.filter(({ permissions }) => hasPermission(permissions))) + return ( - {documentCategories.map(category => ( + {categories.map(category => ( } title={category.title} - permissions={category.permissions} /> ))} - {documentCategories.length > 0 && ( - } /> + {categories.length > 0 && ( + } /> )} } /> - {documentCategories.map(category => ( + {categories.map(category => (