fix: only export action in view collection is support when writableView is false (#6763)

This commit is contained in:
Katherine 2025-04-24 16:32:06 +08:00 committed by GitHub
parent 717177b471
commit 04e17444fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -334,8 +334,11 @@ export const ACLActionProvider = (props) => {
if (!params) {
return <ACLActionParamsContext.Provider value={params}>{props.children}</ACLActionParamsContext.Provider>;
}
//视图表无编辑权限时不显示
if (resourceActionPath.includes(actionPath) || resourceActionPath.includes(actionPath?.split(':')[1])) {
//视图表无编辑权限时仅支持显示导出按钮
if (
['create', 'update', 'destroy', 'importXlsx'].includes(actionPath) ||
['create', 'update', 'destroy', 'importXlsx'].includes(actionPath?.split(':')[1])
) {
if ((collection && collection.template !== 'view') || collection?.writableView) {
return <ACLActionParamsContext.Provider value={params}>{props.children}</ACLActionParamsContext.Provider>;
}
@ -343,7 +346,6 @@ export const ACLActionProvider = (props) => {
}
return <ACLActionParamsContext.Provider value={params}>{props.children}</ACLActionParamsContext.Provider>;
};
export const useACLFieldWhitelist = () => {
const params = useContext(ACLActionParamsContext);
const whitelist = useMemo(() => {