From 716209f89003ecbd7b90f0ec7c7e509a72e5759b Mon Sep 17 00:00:00 2001 From: roger Date: Fri, 10 Feb 2023 16:26:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=B8=8B=E5=86=99?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../file/DefaultTemplateTreeDefineProcessor.java | 10 ++++++---- .../main/java/com/fr/design/file/TemplateTreePane.java | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java b/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java index 63b88132bc..1bcfe3c622 100644 --- a/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java +++ b/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java @@ -230,11 +230,13 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi } //确定目标目录并检查权限 FileOperations selectedOperation = DesignerFrameFileDealerPane.getInstance().getSelectedOperation(); - //没有选中目标目录时粘贴,允许超管往根目录粘贴 - if (selectedOperation.getFileNode() == null && WorkContext.getCurrent().isRoot()) { - return true; + boolean rootAuthority = true; + if (selectedOperation.getFileNode() == null && selectedOperation instanceof TemplateTreePane) { + //没有选中文件节点时,默认粘贴到根目录下,所以直接检测根目录是否有权限 + ExpandMutableTreeNode root = (ExpandMutableTreeNode) ((TemplateTreePane) selectedOperation).getTemplateFileTree().getModel().getRoot(); + rootAuthority = root.hasFullAuthority(); } - if (!selectedOperation.access()) { + if (!rootAuthority && !selectedOperation.access()) { FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied"), Toolkit.i18nText("Fine-Design_Basic_Alert"), diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index 2867c121b6..d985595f5f 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -311,7 +311,7 @@ public class TemplateTreePane extends JPanel implements FileOperations { } reportletsTree.refreshParent(Objects.requireNonNull(reportletsTree.getSelectionPath())); DesignerFrameFileDealerPane.getInstance().refreshRightToolBarBy(null); - FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_File_Tree_Refresh_Successfully") + "!"); + FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_File_Tree_Refresh_Successfully")); }