Browse Source

新增 appconfig.validate.dataPermission数据权限开关

zhontai 2 years ago
parent
commit
338f4d16ce

+ 4 - 2
src/hosts/ZhonTai.Host/Configs/appconfig.json

@@ -15,8 +15,10 @@
   "validate": {
     //登录
     "login": true,
-    //权限
-    "permission": true
+    //接口权限
+    "permission": true,
+    //数据权限
+    "dataPermission": true
   },
   //Swagger文档
   "swagger": {

+ 6 - 1
src/platform/ZhonTai.Admin/Core/Configs/AppConfig.cs

@@ -243,9 +243,14 @@ public class ValidateConfig
     public bool Login { get; set; } = true;
 
     /// <summary>
-    /// 权限
+    /// 接口权限
     /// </summary>
     public bool Permission { get; set; } = true;
+
+    /// <summary>
+    /// 数据权限
+    /// </summary>
+    public bool DataPermission { get; set; } = true;
 }
 
 /// <summary>

+ 1 - 1
src/platform/ZhonTai.Admin/Core/HostApp.cs

@@ -685,7 +685,7 @@ public class HostApp
         app.UseAuthorization();
 
         //登录用户初始化数据权限
-        if (appConfig.Validate.Permission)
+        if (appConfig.Validate.DataPermission)
         {
             app.Use(async (ctx, next) =>
             {

+ 6 - 1
src/platform/ZhonTai.Admin/ZhonTai.Admin.xml

@@ -522,7 +522,12 @@
         </member>
         <member name="P:ZhonTai.Admin.Core.Configs.ValidateConfig.Permission">
             <summary>
-            权限
+            接口权限
+            </summary>
+        </member>
+        <member name="P:ZhonTai.Admin.Core.Configs.ValidateConfig.DataPermission">
+            <summary>
+            数据权限
             </summary>
         </member>
         <member name="T:ZhonTai.Admin.Core.Configs.VarifyCodeConfig">