From 5aef646d337db14d0c10755b4ff97cf74f9455a6 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 10 Sep 2024 14:27:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-133183=20=E3=80=90fr-fbp=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E3=80=90=E6=95=B0=E6=8D=AE=E9=9B=86=E3=80=91?= =?UTF-8?q?236=E7=8E=AF=E5=A2=83=EF=BC=8C=E6=96=B0=E5=BB=BA/=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=AD=98=E5=9C=A8=E9=A9=B1=E5=8A=A8=E7=9A=84mysql?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=EF=BC=8C=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/datapane/connect/ConnectionListPane.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index baa1f74059..a7f606a141 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -262,7 +262,12 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh */ private boolean needUpdate0(Connection origin, Connection connection) { // 先不考虑插件 - return !connection.equals(origin); + try { + return !connection.equals(origin); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return false; + } } /** From 645afdbf977c02b8aba0b4a9106a054322f472f2 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 10 Sep 2024 15:12:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-133535=20=E3=80=90fr-fbp=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E6=A8=A1=E6=9D=BF=E5=86=85=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=89=B4=E6=9D=83=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index ebceb6b141..16d7a054b8 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fanruan.datasource.web.bean.ConnectionAuthorityConfigBean; import com.fanruan.product.ProductConstants; import com.fine.theme.icon.LazyIcon; import com.fr.base.Parameter; @@ -101,6 +102,7 @@ import com.fr.widgettheme.designer.WidgetThemeDisplayAction; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; import com.fr.workspace.server.repository.WorkplaceConstants; +import com.fr.workspace.server.repository.connection.ConnectionRepository; import com.fr.workspace.server.repository.template.TemplateRepository; import javax.swing.BorderFactory; @@ -1749,7 +1751,8 @@ public abstract class JTemplate> } private boolean checkJTemplateAuthority() { - if (!WorkplaceConstants.isConnectionEditAuth()) { + ConnectionAuthorityConfigBean bean = ConnectionRepository.getInstance().getConnectionAuthorityConfig(); + if (!(bean !=null && bean.isConnectionEditAuth())) { return true; } JTemplateAuthorityChecker jTemplateAuthorityChecker = new JTemplateAuthorityChecker(this); From d6508e670b49fc46e92ff1bc295d8debd63aaf2e Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Tue, 10 Sep 2024 16:32:02 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-133535=20=E3=80=90fr-fbp=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E6=A8=A1=E6=9D=BF=E5=86=85=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E9=89=B4=E6=9D=83=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../authority/JTemplateAuthorityChecker.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java b/designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java index a0ed56876d..c0d6247905 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java @@ -29,9 +29,7 @@ import static javax.swing.JOptionPane.WARNING_MESSAGE; public class JTemplateAuthorityChecker { JTemplate jTemplate; - Set allConnectionNames; Set authConnectionNames; - Set allDatasetNames; Set authDatasetNames; Map checkerMap = new HashMap<>(); Set authFailConnectionNames = new HashSet<>(); @@ -47,13 +45,7 @@ public class JTemplateAuthorityChecker { } private void initAuthNames() { - allDatasetNames = new HashSet<>(); - for (String authServerDataSetName : TableDataConfigProviderFactory.getInstance().getTableDatas().keySet()) { - allDatasetNames.add(authServerDataSetName); - } - - allConnectionNames = ConnectionConfigProviderFactory.getConfigProvider().getConnections().keySet(); - + // 无需获取所有数据集和数据连接了,当前只能获取自己有权限的 Map> authNamesMap = RemoteAuthorityRepository.getInstance().getAuthServerDataSetAndConnectionNames(WorkContext.getCurrent().getConnection().getUserName()); if (authNamesMap != null) { //有权限的数据连接名称 @@ -95,8 +87,6 @@ public class JTemplateAuthorityChecker { } } } - authFailConnectionNames.retainAll(allConnectionNames); - authFailDatasetNames.retainAll(allDatasetNames); FineLoggerFactory.getLogger().info("JTemplateAuthorityChecker check time consume:" + (System.currentTimeMillis() - s)); return authFailConnectionNames.size() == 0 && authFailDatasetNames.size() == 0; }