From 8ac84e6e2c0a3d02c2db8793c3fe6390f81d9029 Mon Sep 17 00:00:00 2001 From: Katherine Date: Fri, 18 Apr 2025 13:59:39 +0800 Subject: [PATCH] fix: export button shown without export permission (#6689) --- packages/core/client/src/acl/ACLProvider.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/client/src/acl/ACLProvider.tsx b/packages/core/client/src/acl/ACLProvider.tsx index 09eaf964ad..2fb3d4b3c1 100644 --- a/packages/core/client/src/acl/ACLProvider.tsx +++ b/packages/core/client/src/acl/ACLProvider.tsx @@ -309,15 +309,15 @@ export const ACLActionProvider = (props) => { const schema = useFieldSchema(); const currentUid = schema['x-uid']; let actionPath = schema['x-acl-action']; - const editablePath = ['create', 'update', 'destroy', 'importXlsx']; + // 只兼容这些数据表资源按钮 + const resourceActionPath = ['create', 'update', 'destroy', 'importXlsx', 'export']; - if (!actionPath && resource && schema['x-action'] && editablePath.includes(schema['x-action'])) { + if (!actionPath && resource && schema['x-action'] && resourceActionPath.includes(schema['x-action'])) { actionPath = `${resource}:${schema['x-action']}`; } if (actionPath && !actionPath?.includes(':')) { actionPath = `${resource}:${actionPath}`; } - const params = useMemo( () => actionPath && parseAction(actionPath, { schema, recordPkValue }), [parseAction, actionPath, schema, recordPkValue], @@ -335,7 +335,7 @@ export const ACLActionProvider = (props) => { return {props.children}; } //视图表无编辑权限时不显示 - if (editablePath.includes(actionPath) || editablePath.includes(actionPath?.split(':')[1])) { + if (resourceActionPath.includes(actionPath) || resourceActionPath.includes(actionPath?.split(':')[1])) { if ((collection && collection.template !== 'view') || collection?.writableView) { return {props.children}; }