Browse Source

添加和恢复从 AppSettingsHelper 获取 FeeBasePerm 的代码

在 EnterExitCostDraftRepository.cs 文件中,添加了从 AppSettingsHelper 获取 FeeBasePerm 的代码,并检查 FeeBasePerm 中是否包含当前用户的 ID,如果包含则返回 true。

在 EnterExitCostRepository.cs 文件中,恢复了之前被注释掉的 从 AppSettingsHelper 获取 FeeBasePerm 的代码,并检查 FeeBasePerm 中是否包含当前用户的 ID,如果包含则返回 true。
LEIYI 2 months ago
parent
commit
9e893edf34

+ 3 - 0
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostDraftRepository.cs

@@ -73,6 +73,9 @@ namespace OASystem.Infrastructure.Repositories.Groups
             var permissionIds = new List<int>() { 1, 2, 3, 4, 5 };
             if (!permissionIds.Contains(permission)) return false;
 
+            var feeBasePerm = AppSettingsHelper.Get<PermissionViewUserview>("FeeBasePerm");
+            if (feeBasePerm.Any(x => x.Id == userId)) return true;
+
             var info = await _sqlSugar.Queryable<Grp_EnterExitCostDraftPermission>()
                 .Where(it => it.DraftId == darftId && it.UserId == userId && it.Permission == permission)
                 .FirstAsync();

+ 2 - 2
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostRepository.cs

@@ -80,8 +80,8 @@ namespace OASystem.Infrastructure.Repositories.Groups
             var permissionIds = new List<int>() { 1, 2, 3, 4, 5 };
             if (!permissionIds.Contains(permission)) return false;
 
-            //var feeBasePerm = AppSettingsHelper.Get<PermissionViewUserview>("FeeBasePerm");
-            //if (feeBasePerm.Any(x => x.Id == userId)) return true;
+            var feeBasePerm = AppSettingsHelper.Get<PermissionViewUserview>("FeeBasePerm");
+            if (feeBasePerm.Any(x => x.Id == userId)) return true;
 
             var info = await _sqlSugar.Queryable<Grp_EnterExitCostPermission>()
                 .Where(it => it.GroupId == groupId && it.UserId == userId && it.Permission == permission)