From d196033b13e850994aec173ede36edb9e481e1ed Mon Sep 17 00:00:00 2001 From: chenpei Date: Thu, 20 Aug 2026 17:09:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9D=83=E9=99=90=E7=BB=84=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E5=88=86=E4=BA=AB=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 分享不参与判定,界面不再配置这一项。 --- app/api/organization/permission-groups/route.ts | 2 +- .../department-dashboard/PermissionGroupsDashboard.test.tsx | 1 + components/department-dashboard/PermissionGroupsDashboard.tsx | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/api/organization/permission-groups/route.ts b/app/api/organization/permission-groups/route.ts index 67367815..72769511 100644 --- a/app/api/organization/permission-groups/route.ts +++ b/app/api/organization/permission-groups/route.ts @@ -258,7 +258,7 @@ export async function PUT(request: NextRequest) { canView: Boolean(item.canView), canDownload: Boolean(item.canDownload), canDownloadSource: Boolean(item.canDownloadSource), - canShare: item.canShare !== false, + canShare: true, })), ) return NextResponse.json({ ok: true }) diff --git a/components/department-dashboard/PermissionGroupsDashboard.test.tsx b/components/department-dashboard/PermissionGroupsDashboard.test.tsx index 60d7c9e5..67a4c7bd 100644 --- a/components/department-dashboard/PermissionGroupsDashboard.test.tsx +++ b/components/department-dashboard/PermissionGroupsDashboard.test.tsx @@ -73,6 +73,7 @@ describe('PermissionGroupsDashboard', () => { expect(within(screen.getByRole('navigation', { name: '权限组' })).getByRole('button', { name: /运营/ })).toBeInTheDocument() expect(screen.getByText('已在本组')).toBeInTheDocument() expect(screen.getByRole('columnheader', { name: '可见' })).toBeInTheDocument() + expect(screen.queryByRole('columnheader', { name: '分享' })).not.toBeInTheDocument() expect(screen.getByRole('link', { name: '按人看权限' })).toHaveAttribute( 'href', '/workspaces/governance/user-permissions', diff --git a/components/department-dashboard/PermissionGroupsDashboard.tsx b/components/department-dashboard/PermissionGroupsDashboard.tsx index 0a9dfb9c..fb2415e5 100644 --- a/components/department-dashboard/PermissionGroupsDashboard.tsx +++ b/components/department-dashboard/PermissionGroupsDashboard.tsx @@ -49,11 +49,10 @@ type Payload = { groups: Group[] } -const FLAG_COLUMNS: Array<{ key: keyof MaterialPermissionFlags; label: string }> = [ +const FLAG_COLUMNS: Array<{ key: Exclude; label: string }> = [ { key: 'canView', label: '可见' }, { key: 'canDownload', label: '下载' }, { key: 'canDownloadSource', label: '源文件' }, - { key: 'canShare', label: '分享' }, ] const emptyFlags = (): MaterialPermissionFlags => ({ @@ -250,6 +249,7 @@ export default function PermissionGroupsDashboard() { permissions: payload.materialTypes.map((materialType) => ({ materialType, ...(selectedFlags[materialType] || emptyFlags()), + canShare: true, })), }, '这组权限已保存,组和人一起变',