diff --git a/app/api/organization/permission-groups/route.ts b/app/api/organization/permission-groups/route.ts index 6736781..7276951 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 60d7c9e..67a4c7b 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 0a9dfb9..fb2415e 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, })), }, '这组权限已保存,组和人一起变',