Browse Source

优化权限验证逻辑并清理无用代码

在 `EnterExitCostDraftRepository.cs` 文件中,修改了权限验证逻辑。原来的代码只检查 `assignPerm`,现在增加了一个条件,即如果 `enterExitCostDraftData.CreateUserId` 等于 `dto.CurrUserId`,也会赋予操作权限和查看权限。

在 `EnterExitCostRepository.cs` 文件中,删除了一些注释代码和空行,优化了代码的整洁度。
LEIYI 2 months ago
parent
commit
6249fd0b81

+ 1 - 1
OASystem/OASystem.Infrastructure/Repositories/Groups/EnterExitCostDraftRepository.cs

@@ -137,7 +137,7 @@ namespace OASystem.Infrastructure.Repositories.Groups
 
                     bool assignPerm = await PermissionValidationAsync(enterExitCostDraftData.Id, dto.CurrUserId);
 
-                    if (assignPerm)
+                    if (assignPerm || enterExitCostDraftData.CreateUserId == dto.CurrUserId)
                     {
                         enterExitCostInfoView.IsSave = true; //操作权限
                         enterExitCostInfoView.IsView = true; //查看权限

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

@@ -207,8 +207,6 @@ namespace OASystem.Infrastructure.Repositories.Groups
                             .ToArrayAsync();
                     }
 
-                   
-
                     //enterExitCostInfoView.FirstItemRemark = enterExitCostData.Remark;
                     var dayAndCostSql = string.Format(@"Select ntf.Country,ntf.City,ssd.Name CurremcyCode,ssd.Remark CurrencyName,gdac.* From Grp_DayAndCost gdac
                                                         Left Join Grp_NationalTravelFee ntf On ntf.Id = gdac.NationalTravelFeeId