From 34981c30a78e8bbd7791131059a9210f9928b62c Mon Sep 17 00:00:00 2001
From: 刘光辉 <347230014@qq.com>
Date: 星期四, 17 九月 2026 09:24:09 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into master
---
jnpf-dms/jnpf-dms-biz/src/main/java/jnpf/dmsPermission/DmsTrustedServiceGuard.java | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/jnpf-dms/jnpf-dms-biz/src/main/java/jnpf/dmsPermission/DmsTrustedServiceGuard.java b/jnpf-dms/jnpf-dms-biz/src/main/java/jnpf/dmsPermission/DmsTrustedServiceGuard.java
new file mode 100644
index 0000000..4debf86
--- /dev/null
+++ b/jnpf-dms/jnpf-dms-biz/src/main/java/jnpf/dmsPermission/DmsTrustedServiceGuard.java
@@ -0,0 +1,19 @@
+package jnpf.dmsPermission;
+
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Component;
+
+@Component
+@RequiredArgsConstructor
+public class DmsTrustedServiceGuard {
+ private final DmsPermissionProperties properties;
+
+ public String requireAllowed(String serviceId) {
+ String normalized = serviceId == null ? "" : serviceId.trim();
+ if (normalized.isEmpty() || !properties.getResourceRegistrationServiceIds().contains(normalized)) {
+ throw DmsPermissionException.of(DmsPermissionError.TRUSTED_SERVICE_REQUIRED,
+ "璧勬簮鍒涘缓璋冪敤鏂逛笉鍦� DMS 鍙椾俊鏈嶅姟鐧藉悕鍗曚腑");
+ }
+ return normalized;
+ }
+}
--
Gitblit v1.8.0